P
PeteSmith
I am trying to hide or show Excel Toolbars form VB.Net automation but keep getting Com exceptions on the code below
The error message typically says call rejected by callee, and I can sometimes determine which commandbar is being referred to from the watch window, but not always.
it started to occur when trying to restore visibility of toolbars on closing application, but now also occures on hiding
Code I'm using is as follows
For y = 1 To xlapp.CommandBars.Coun
If CStr(xlapp.CommandBars(y).NameLocal) <> "Worksheet Menu Bar" The
If xlapp.CommandBars(y).Visible The
ReDim Preserve xlTBarNames(x
xlTBarNames(x) = xlapp.CommandBars(y).NameLocal.ToStrin
x +=
End I
End I
Next
The error message typically says call rejected by callee, and I can sometimes determine which commandbar is being referred to from the watch window, but not always.
it started to occur when trying to restore visibility of toolbars on closing application, but now also occures on hiding
Code I'm using is as follows
For y = 1 To xlapp.CommandBars.Coun
If CStr(xlapp.CommandBars(y).NameLocal) <> "Worksheet Menu Bar" The
If xlapp.CommandBars(y).Visible The
ReDim Preserve xlTBarNames(x
xlTBarNames(x) = xlapp.CommandBars(y).NameLocal.ToStrin
x +=
End I
End I
Next