Thread: Do Until ??
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
BEEJAY BEEJAY is offline
external usenet poster
 
Posts: 247
Default Do Until ??

Should also have mentioned that error code shows up:
Run Time error # 5 - Invalid Procedure Call or Argument.
When I select debug, the first Application.Commandbars.......
line is hi-lited.


"Jim Cone" wrote:

Beejay,

Try adding a line in the code that excludes your custom toolbars...
(untested)
'-------------------
If cbar.Visible Then
If InStr(1, cbar.Name, "JFS-", vbTextCompare) = 0 Then
TBarCount = TBarCount + 1
Sheets("Sheet1").Cells(TBarCount, 1) = cbar.Name
cbar.Visible = False
End If
End If
'-------------------
Regards,
Jim Cone
San Francisco, USA


"BEEJAY"
wrote in message

Jim:
1: Command bars DO appear automatically
2: Application is as follows:
When I have to work on someone elses computer, I want to be able to
use my extensive elaborate tool bars, which include all the standard
type items I use as well as specials (with macros). When I leave the
computer, I need to be able to restore the toolbar(s) to that computers
orginial setting. Therefore, in order not to loose usable work area by
having too many lines used for toolbars, I want to temporarily remove
the original settings.
I hope this makes things clearer.
I hope this can all be done by opening ONE file.
I could, of coarse, have one file do the "remove", and the 2nd file to add my
toolbars, then reverse order close them, to restore settings.
Thanks for info, so far.

"Jim Cone" wrote:

Beejay,

If the new command bars are attached to the workbook, then they will
appear automatically. They do not have to made visible.
You however, should still delete them when the workbook closes.
As far as hiding the built-in toolbars, this is not good practice as all workbooks
in the application will have the toolbars hidden.
Alternatively, you might want to just hide the "Standard" and "Formatting" toolbars.
Jim Cone
San Francisco, USA