You are correct.
The problem will also show up in the SaveSettingIni .
change:
to:WriteSettingIni (YOUR_TOOLBAR_NAME)
change:WriteSettingIni (Application.CommandBars(YOUR_TOOLBAR_NAME))
to:SaveSettingIni (YOUR_TOOLBAR_NAME)
BTW I have changed the subs to:SaveSettingIni (Application.CommandBars(YOUR_TOOLBAR_NAME))
Sub SaveSettingIni(iToolBar As CommandBar) Dim DirLoc As String DirLoc = "C:\Program Files\Microsoft Office\OFFICE11\ADDINS\" With iToolBar WriteIniValue DirLoc & "MyADDIN.ini", "Settings", "Position", _ CStr(.Position) WriteIniValue DirLoc & "MyADDIN.ini", "Settings", "RowIndex", _ CStr(.RowIndex) WriteIniValue DirLoc & "MyADDIN.ini", "Settings", "Left", CStr(.Left) WriteIniValue DirLoc & "MyADDIN.ini", "Settings", "Top", CStr(.Top) End With End Sub Sub ReadSettingIni(iToolBar As CommandBar) Dim DirLoc As String DirLoc = "C:\Program Files\Microsoft Office\OFFICE11\ADDINS\" With iToolBar .Position = Val(ReadIniValue(DirLoc & "MyADDIN.ini", "Settings", _ "Position")) .RowIndex = Val(ReadIniValue(DirLoc & "MyADDIN.ini", "Settings", _ "RowIndex")) .Left = Val(ReadIniValue(DirLoc & "MyADDIN.ini", "Settings", "Left")) .Top = Val(ReadIniValue(DirLoc & "MyADDIN.ini", "Settings", "Top")) End With End Sub
it may make more sense now. So change WriteSettingIni to ReadSettingIni and you should be up and running!
![]()





it may make more sense now. So change WriteSettingIni to ReadSettingIni and you should be up and running!
Reply With Quote