Return Print caption to default

Drmwvr7266

Board Regular
Joined
Apr 7, 2002
Messages
164
I have used this code to reset Excel after using a program. However, I cannot reset the caption on the print button. Initially, the button was disabled and the caption changed to "Print option diasbled". Now I can't reset it to the default. I have tried "" and also "Print". But because of multiple printers, it's impossible to tell which printer is being used with a false caption being displayed.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call DeleteMenu
' Closes menu in this program
Application.CommandBars("Standard").Controls(6).Enabled = True
Application.CommandBars("Standard").Controls(6).Caption = ""

End Sub


Does anyone know the default? When I shut down excel and restart it, it defaults to what it should say: PRINT (Deskjet895). Suggestions?

Another quick question: Using the above code, where or how would I limit the effects to THISWORKBOOK?
This message was edited by Drmwvr7266 on 2002-08-26 08:20
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
<pre>CommandBars("standard").Controls(6).Reset</pre> will restore the original caption.

The button property seems to be an application-level setting.. if you want to disable it only in one workbook, you can try switching it on/off during the workbook_activate/deactivate event. That way, the user will be able to print from other books than the one in question.
This message was edited by swamp thing on 2002-08-26 09:07
This message was edited by Swamp Thing on 2002-08-26 09:09
 
Upvote 0
Thank you. I tried the worksheet activate event but it seems to limit me on other open workbooks. So I guess for now , I will just have to live with what I have.

Thanks for the .reset code. That helps alot.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top