I have just moved from a laptop running XP/Excel 2007 to a laptop running Windows 8 64-bit/Excel 2013 (installed via Office 365).

I have a .xlsm file that is stored in a Dropbox folder. It contains a macro which prints various sheets from the graph into 7 pdf files stored in other Dropbox 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 Dropbox folders (and the same Dropbox folder structure).

However on my Windows 8 laptop running Excel 2013, I can get the macro to complete successfully only if it is in a separate test environment (i.e. folders under my My Documents folder and not folders that are in Dropbox). When I run the macro from the Excel spreadsheet that is in Dropbox, it generally 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?