print

npiere

New Member
Joined
Sep 4, 2002
Messages
2
I have a print button on my worksheet I want to be used, so is it possible to disable the print option on the file menu and the Ctrl-P option?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
You could copy the code assigned to your print button to the Workbook_BeforePrint procedure. Then it won't matter whether the user clicks your button or prints normally.
 

stevebausch

Well-known Member
Joined
May 11, 2002
Messages
810
Is this about printing a "hidden" sheet?

I have also intended to force user to use a button of my design, not the stock printing routines.

That was all about printing a sheet not visible to the user, not visible to Excel.

I gave up on disabling/hiding the stock Excel icon/menu selection. Because hiding those will drive the user CRAZY.

Consider accomplishing your goal another way:

In WorkBook_BeforePrint, test for ActiveSheet.Name, or ActiveSheet.CodeName.

If user is attempting to print the "wrong" sheet, set Cancel to True, pop up a MsgBox to inform the user of the error in their ways.


The way I am now meditating on is this:

DON'T CREATE A HIDDEN SHEET, AND EXPECT TO PRINT IT WITHOUT A LOT OF GRIEF.

I asked myself the following question:
Am I using more than half the columns? No, I wasn't. Not even ten percent of columns

I am already manipulating PrintArea, if I set PrintArea to the area I am preparing/formatting, AND that area is on the visible sheet, that keeps the user, and Excel, contented, not confused.

If this sounds like a technique to investigate, let me know. I will continue with the topics of ScrollArea, and how Locked cells/Protection figure in on my plan.




_________________
This message was edited by stevebausch on 2002-10-12 11:22
 

Forum statistics

Threads
1,144,363
Messages
5,723,914
Members
422,527
Latest member
JayTheKaz

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
Top