Hello Everyone,
I built a sheet in Excel 2010 that contains the following VB code:
this works fine in 2010 but now the sheet needs to run in Excel 2003. The problemPrivate Sub Workbook_Open()
Application.CommandBars.FindControl(ID:=2521).Enabled = False
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars.FindControl(ID:=2521).Enabled = True
End Sub
is that when I open the sheet in 2003 I am met with the following error message:
Run-time error '91':
Object variable or With block variable not set
I am just trying to disable the toolbar printer icon so that I cannot be pressed!
In 2010 the above code fades the icon out disabling it.
I only want the user to print using a button that has a macro attached to it already. The reason is because if they print using the print button on the toolbar every page will print! The macro that is attached to the print button that I have created will print only a specified page break range! If they print from the tool bar button 47 pages will print instead of just 1!
Any help is much appreciated.
Regards,
Margate
Bookmarks