A
Ayaz Hoda
I am trying to find a way to load customize menu, as defined in Ribbon UI
Customization in Access 2007.
An Autoexec macro that calls that procedure by using Runcode action
Function LoadRibbons()
Dim i As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = Application.CurrentDb
uid = CUser()
If uid = 66 Then
For i = 0 To (db.TableDefs.count - 1)
If (InStr(1, db.TableDefs(i).Name, "Ribbons")) Then
Set rs = CurrentDb.OpenRecordset(db.TableDefs(i).Name)
rs.MoveFirst
While Not rs.EOF
MsgBox "User ribbon"
Application.LoadCustomUI rs("RibbonName").Value,
rs("RibbonXml").Value ' Error on this line Runtime error 32609, Cannot load
customization 'test2' this customization was already loaded
Wend
rs.Close
Set rs = Nothing
End If
Next i
End If
db.Close
Set db = Nothing
End Function
Please any suggestion or advice
Thanks
Customization in Access 2007.
An Autoexec macro that calls that procedure by using Runcode action
Function LoadRibbons()
Dim i As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = Application.CurrentDb
uid = CUser()
If uid = 66 Then
For i = 0 To (db.TableDefs.count - 1)
If (InStr(1, db.TableDefs(i).Name, "Ribbons")) Then
Set rs = CurrentDb.OpenRecordset(db.TableDefs(i).Name)
rs.MoveFirst
While Not rs.EOF
MsgBox "User ribbon"
Application.LoadCustomUI rs("RibbonName").Value,
rs("RibbonXml").Value ' Error on this line Runtime error 32609, Cannot load
customization 'test2' this customization was already loaded
Wend
rs.Close
Set rs = Nothing
End If
Next i
End If
db.Close
Set db = Nothing
End Function
Please any suggestion or advice
Thanks