Help with PrintPreview

HunterN

Active Member
Joined
Mar 19, 2002
Messages
479
I have the following in a macro for the command button 'Print':

ActiveSheet.PrintPreview

My question is once you execute this, it makes dashlines around the worksheet. After I print and come back to this worksheet how do I take away these dashlines? Also if I use the PrintPreview command, and the user chooses 'Cancel' how can I know they hit Cancel and not OK from the PrintPreview screen?

Thanks your any help. Nancy
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
On 2002-09-17 10:18, HunterN wrote:
I have the following in a macro for the command button 'Print':

ActiveSheet.PrintPreview

My question is once you execute this, it makes dashlines around the worksheet. After I print and come back to this worksheet how do I take away these dashlines? Also if I use the PrintPreview command, and the user chooses 'Cancel' how can I know they hit Cancel and not OK from the PrintPreview screen?

Thanks your any help. Nancy

Hello,

It's not clear what you're asking...

What dashlines appear around the worksheet? Do you mean the margins? What are you trying to achieve here? Do you want to know if the user has printed something out?
 
Upvote 0
I guess I mean the Margins! The worksheet now has dashlines and I want to know how to remove them. I know they do not affect the worksheet and will not print out. I was just wondering if there is a way to remove them.

The other question is this: Once I've gone into Print Preview, and choose 'Print' the box comes up that allows me to change printers if I need to and also gives me the option of selecting 'OK' or 'Cancel', since I am in a system dialog box and not one I created I have no why to know if they chose OK or Cancel. Or is there a way? I only need to know this because I go to a different sheet if they hit OK. I hope this makes more sense.
 
Upvote 0
Hello,

The margins can be toggled on and off by pressing the Margins button.

I can't see a way of doing any of the stuff you want using normal VBA. However, I won't say it's impossible but it would probably involve some horrendous coding. Please, someone prove me wrong :)
 
Upvote 0
Ok, so what is the Margins button? I've tried to find it in Excel Help, but no help!
 
Upvote 0
At the uppermost menus, there is a View selection.

View-Normal

Does that take away your 'dotted line'?

It should also take away the "Page 1" notation in the center of the screen.
 
Upvote 0
I tried the View -> Normal to take away the dashed lines, but it does not change anything.

I'll keep trying! Any other suggestions?
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,377
Members
448,888
Latest member
Arle8907

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