Hi All,
I am trying to create a macro to go through a list of dates (reports) and save them individually as PDFs in my area.
I get the following error:
Run-time error '1004':
Document not saved. the document may be open, or an error may have been encountered when saving.
Below is the macro used, I have used this macro before on a different report and it worked.
Sub Printing()
For i = 35 To 294
Sheets("Merthyr Printout").Select
Cells(81, 8) = Cells(i, 34)
Post_Script
Next i
End Sub
Sub Post_Script()
Sheets("Merthyr Printout").Select
crit = Cells(3, 34)
'Sheets("Merthyr Printout").Select
Dim temp As String
temp = "W:\People Report\Reports\Merthyr\Printout" & crit & ".pdf"
'ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=temp, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
Please help!!!
Cheers,
Jav
I am trying to create a macro to go through a list of dates (reports) and save them individually as PDFs in my area.
I get the following error:
Run-time error '1004':
Document not saved. the document may be open, or an error may have been encountered when saving.
Below is the macro used, I have used this macro before on a different report and it worked.
Sub Printing()
For i = 35 To 294
Sheets("Merthyr Printout").Select
Cells(81, 8) = Cells(i, 34)
Post_Script
Next i
End Sub
Sub Post_Script()
Sheets("Merthyr Printout").Select
crit = Cells(3, 34)
'Sheets("Merthyr Printout").Select
Dim temp As String
temp = "W:\People Report\Reports\Merthyr\Printout" & crit & ".pdf"
'ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=temp, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
Please help!!!
Cheers,
Jav