Batch printing without prompts

  • Thread starter Thread starter John Smith
  • Start date Start date
J

John Smith

Hi,

I have a lot of excel files which I highlight and print by right clicking in
explorer - however after printing each file it asks if I want to "save
changes" - how can I stop this prompt every time - it annoying trying to
print 200 files.

Regards

JS
 
I think I'd use a macro to get the filenames, open, print and close without
saving.

Something like:

Option Explicit
Sub testme()

Dim myFileNames As Variant
Dim iCtr As Long
Dim wkbk As Workbook

myFileNames = Application.GetOpenFilename _
(filefilter:="Excel Files, *.xls", MultiSelect:=True)

If IsArray(myFileNames) Then
For iCtr = LBound(myFileNames) To UBound(myFileNames)
Set wkbk = Workbooks.Open(Filename:=myFileNames(iCtr))
ActiveSheet.PrintOut preview:=True
wkbk.Close savechanges:=False
Next iCtr
End If

End Sub

I used preview:=true to save some trees while testing.

And I printed the activesheet in that newly opened workbook. I'm not sure what
you were printing via the right click stuff.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
I just checked the sheets - some cells in each sheet have a random number
assigned every time the sheet is opened , so when printing the sheet is
opened /changed causing the prompt
 
Back
Top