print w/o opening or open and print one at a time?

josh_m

Board Regular
Joined
Mar 26, 2009
Messages
81
ok, 1st post, here goes...
I have a macro where I can open multiple sheets, print a specific tab, close the sheet and move on to the next one until they are all done. Problem is I need to open so many it bogs down the pc.

Can I select all to be printed and print a specific tab without actually opening the file?
Or...
Can I select all to be printed, have them open, print, close one at a time?

here is my current code:

Sub PRINT_AUDIT()

Application.FindFile

Application.DisplayAlerts = False

For Each Workbook In Workbooks

Sheets("Margin Summary").PrintOut
ActiveWindow.Close

Next

End Sub
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
No, you can't print a file without opening it.

Why do you think that opening the files one at a time would be faster than the code that you've already got?
 
Upvote 0

josh_m

Board Regular
Joined
Mar 26, 2009
Messages
81
i usually have around 80 files at a time to open and print, each at ~3.5MB. my pc can't handle opening that many at a time and I get something like a "out of system resources" error message if i try, so i have to run my code on smaller batches. I thought if there was a way to close the current file before the next one opens, my pc could handle that and I could select all files and let it run saving me a lot of time.
 
Upvote 0

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
Ah, I see. How about having a list of files somewhere ( in a sheet ) that you could loop through, doing the processing that way?
 
Upvote 0

Forum statistics

Threads
1,191,036
Messages
5,984,273
Members
439,881
Latest member
Amitoj95

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