KathyS_893
New Member
- Joined
- Apr 7, 2013
- Messages
- 1
I have just moved from a laptop running XP/Excel 2007 to a laptop running Windows 8 64-bit/Excel 2013.
I have a .xlsm file that contains a macro which prints various sheets from the graph into 7 pdf files stored in other folders. The part of code that creates (i.e. overwrites the existing pdfs) is:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
myPath & myfilename & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
The value of myPath is derived from the workbook's path. This macro has always worked fine on my old laptop, and has been running successfully on other XP/Excel 2007 computers that share the same folder structure.
However on my Windows 8 laptop running Excel 2013, it usually reports a 1004 error (i.e. can't save the file) on the first instance of the above code. However the first pdf file HAS actually been created. Also, if I re-run the macro, sometimes it will create 3 or 4 of the pdf files, and fail (with the same error) only on the last ones.
Does anyone have any ideas about what could be causing this change in behaviour, or can anyone suggest a better method of reliably creating these pdf files in Excel 2013?
I have a .xlsm file that contains a macro which prints various sheets from the graph into 7 pdf files stored in other folders. The part of code that creates (i.e. overwrites the existing pdfs) is:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
myPath & myfilename & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
The value of myPath is derived from the workbook's path. This macro has always worked fine on my old laptop, and has been running successfully on other XP/Excel 2007 computers that share the same folder structure.
However on my Windows 8 laptop running Excel 2013, it usually reports a 1004 error (i.e. can't save the file) on the first instance of the above code. However the first pdf file HAS actually been created. Also, if I re-run the macro, sometimes it will create 3 or 4 of the pdf files, and fail (with the same error) only on the last ones.
Does anyone have any ideas about what could be causing this change in behaviour, or can anyone suggest a better method of reliably creating these pdf files in Excel 2013?