Hi
I am having problems with a couple of macros that i am using to save an Excel workbook and also to create & save PDF version of the same file. All macros work fine on my laptop where the initial workbook was created but i get a Runtime 1004 error for both macros whenever i try and run the macros on any other pc.
The macros is am using are (these are tied to a MasterMacro using the Call function to call each in turn).
Sub Macro1()
'
' Macro1 Macro
' This saves the workbook as an.xlsm workbook with a name the same as cell C20 on the activesheet
ActiveSheet.Unprotect "password"
Sheet1.Range("c10").FormulaR1C1 = "=IF(RC[8]=0,"""",NOW())"
ActiveSheet.Protect "password"
ActiveWorkbook.SaveAs Filename:="C:\" & Range("c20").Value, FileFormat _
:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End Sub
Sub Macro2()
' This converts the activesheet to a pdf and opens it for viewing
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\" & Range("c20").Value _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub
Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. Even though you have been a member for 3 years, I have added them for you this time because you only have a few posts. --6StringJazzer
Bookmarks