Printer paper size

robfo0

Active Member
Joined
Feb 19, 2002
Messages
281
Is there a way to change the paper size that a printer will use from vb? I tried recording a macro, but it only caught the bit when i changed printers. I tried to specify a default paper size in windows, and it SAYS its correct, but when excel opens the file, it changes back to letter! Help please!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Most print sizes are controlled by the software file settings, and not Windows, with the exception of Visio, I believe. Change the settings in the file, not the printer.
 
Upvote 0
Ok, i did that, BUT i have computers with multiple operating systems running. when i save the settings on a win2k computer, it will work for win2k and 98 computers, but not xp computers, visa versa for xp computers. So is there a way to change the settings in the file with VBA??

Thanks :)
 
Upvote 0
If you want to set a paper size in excel

sub papersize()
Worksheets("Sheet1").PageSetup.PaperSize = xlPaperLegal

end sub


take online help for setting paper size to be used in vbe for excel.

ni****h desai
 
Upvote 0
nisht,

This looks like the solution I have been hunting for. But one problem, the paper size I'm trying to change to is a custom form called "Epson Dot Matrix".

I tried
Worksheets("Sheet1").PageSetup.PaperSize = xlPaperUser("Epson Dot Matrix")
and a few other combinations but these dont work. How would i do this?

Thanks!
This message was edited by robfo0 on 2002-03-19 19:00
 
Upvote 0
first define a custom paper size in your epson..printer and then use xlpaperuser..

Actually i have not tried the code but this will solve your problem... you dont need to write anything in brackets.

I exactly mean is that you have to define your custom paper size first.

I your problem is solve please mail me.. so i dont have to try the code.
ni****h desai
 
Upvote 0
Thanks so much for trying to help me, i still didnt get it to work with this method. I do have the paper type defined and it is called "Epson Dot Matrix" and i tried xlPaperUser and that doesnt work either. I did some extensive searching and found this method:

it uses the sendkeys to simulate a user doing it! heres the code:

Sub paperchange()
xSource = "ep"
SendKeys "%fu{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}" & xSource & "~~"
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,972
Members
448,537
Latest member
Et_Cetera

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