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 problem
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 it 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 that will print just 1 set page that has the page breaks set to the area I want to print. If the user presses the toolbar print icon 47 pages will be printed out instead of just the 1 that they need!
Any help is much appreciated.
Regards,
Margate
I built a sheet in Excel 2010 that contains the following VB code:
Code:
Private 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
this works fine in 2010 but now the sheet needs to run in Excel 2003. The problem
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 it 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 that will print just 1 set page that has the page breaks set to the area I want to print. If the user presses the toolbar print icon 47 pages will be printed out instead of just the 1 that they need!
Any help is much appreciated.
Regards,
Margate