View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Edgar[_3_] Edgar[_3_] is offline
external usenet poster
 
Posts: 40
Default Do not print if error

Hi

I have the following code which saves an invoice to my hd
and then prints it.

Is it possible for the macro to stop if the invoice
already exists on my hard disk?

Sub MetroparkPrint()

' MetroParkPrint Macro
' Macro to save and then print an invoice

ActiveWorkbook.SaveAs ("c:\Metropark\" & Range("j10")
& ".xls")

With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Zoom = 80
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
End Sub

Thanks

Edgar