Hi,
I have created a custom ribbon using VBA + XML, which works fine. But while closing the active workbook, i want to remove the ribbon.
Which is not happeneing. How do I really remove the ribbon and load it fresh each time the excel is closed and open. Below is the code which I am using, please tell me where am i going wrong
Dim hFile As Long
Dim path As String, fileName As String, ribbonXML As String, user As String
hFile = FreeFile
user = Environ("Username")
path = "C:\Users" & user & "\AppData\Local\Microsoft\Office"
fileName = "Excel.officeUI"
ribbonXML = "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui"">" & _
"<mso:ribbon></mso:ribbon></mso:customUI>"
Open path & fileName For Output Access Write As hFile
Print #hFile, ribbonXML
Close hFile
Thanks !!
I have created a custom ribbon using VBA + XML, which works fine. But while closing the active workbook, i want to remove the ribbon.
Which is not happeneing. How do I really remove the ribbon and load it fresh each time the excel is closed and open. Below is the code which I am using, please tell me where am i going wrong
Dim hFile As Long
Dim path As String, fileName As String, ribbonXML As String, user As String
hFile = FreeFile
user = Environ("Username")
path = "C:\Users" & user & "\AppData\Local\Microsoft\Office"
fileName = "Excel.officeUI"
ribbonXML = "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui"">" & _
"<mso:ribbon></mso:ribbon></mso:customUI>"
Open path & fileName For Output Access Write As hFile
Print #hFile, ribbonXML
Close hFile
Thanks !!