Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing excel & word

Status
Not open for further replies.

GShen

MIS
Sep 26, 2002
561
US
I have an ACCESS program printing excel documents and word documents using the PrintExcel and PrintWord commands. Work great. When there are mult. pages in word, the printer prints them each on 1 page. When there are mult. pages in excel, it is trying to print them on all 1 page and shrinks them down to where you need a magnifying glass. If I open the document and print it, it prints fine. So something in ACCESS has to be doing this but I do not see any print options with this command. Do I have to print the excel document with different VBA code to set a property?

Remember when... everything worked and there was a reason for it?
 
sorry everyone. Brain lapse. Those are 2 macros I created. So the real question is, what object option will set this to print on seperate pages. This what I have.

Dim ExcelObj As Object
Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.workbooks.Open RptToPrint
ExcelObj.activesheet.PageSetup.Zoom = False
ExcelObj.activesheet.PageSetup.FitToPagesWide = 1
ExcelObj.activesheet.PageSetup.PaperSize = 1 'Set to letter size
ExcelObj.displayAlerts = False

ExcelObj.activewindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ExcelObj.Quit
Set ExcelObj = Nothing

Remember when... everything worked and there was a reason for it?
 
hi,
Code:
'...
ExcelObj.activesheet.PageSetup.FitToPagesWide = 1
ExcelObj.activesheet.PageSetup.FitToPagesTall = 1
'...


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
hey there. Thanks. I set ExcelObj.activesheet.PageSetup.FitToPagesTall = 1 and it did not work. I set ExcelObj.activesheet.PageSetup.FitToPagesTall = 100 and now it works.

DOes that set it to 100 pages and 1 says set it to 1 page ?

Remember when... everything worked and there was a reason for it?
 
What does, "and it did not work" actually mean? Your PC blew up? World peace broke out instead? Or something else?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I guess I don't really understand how you are trying to print the worksheet.

Do you want to ALL on ONE PAGE (1 wide & 1 tall) or One page wide and however many tall (1 wide and 999 tall)?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Skip,
In my original post I stated all pages were printing on the same page really small. That is what I meant by did not work. I had a doc. of 4 pages all printing on 1 page. I need 4 pages to print. Orig. I think I had it set to 1 because the user was putting 1 - 3 extra lines on a the spreadsheet and causing it to go to 2 pages. At the time we wanted it all on 1 page (vertical). Now things have changed and they need 1-6 pages printed and obviously in doing so they are all printing on the same page. I need 1-6 pages.
Sorry for the confusion. That being said, it is working (meaning printing on separate pages) when I set the TALL to 100.

Thanks for all your help.



Remember when... everything worked and there was a reason for it?
 
Check out the Page Break Preview mode. You can actually DRAG the breaks to where you want them if necessary.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Ok thanks. I have another question. Where can I get a list of all the options and what they do when doing this stuff? Intellisense does not work. I looked all over the place and can't find a place where this is hiding? ...

Remember when... everything worked and there was a reason for it?
 
In the VB Editor, Tools > Options -- Editor Tab CHECK Auto List Members

In fact, I have ALL option in this tab checked, and I would recommend doing so.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top