just wondering where to put this macro. It’s supposed to cause correctly labelled excel files ato save as PDF as well whenever the user hits save. I have a similar Macro working without issue for Word, but for the life of me I can’t seem to work out where this macro goes.
I’m running on Xp Sp3 with Excel 2007. I’ve tried saving it in a module within a .xlam to C:\Program Files\Microsoft Office\Office12\XLSTART, C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Office\12.0, C:\Documents and Settings\username\Templates etc. but no joy?
Am I missing something obvious (no surprise)?
Sub FileSave()
'
' FileSave Macro
'
'
Dim StrFile As String
Dim StrPath As String
Dim StrName As String
Dim StrPDFName As String
StrPath = ActiveSheet.Path 'Get document path
StrFile = ActiveSheet.Name 'Get document name
If StrName <> "" Then
MsgBox "We have a string name"
StrName = Left(StrFile, (InStr(StrFile, ".") - 1))
StrPDFName = StrPath + "\" + StrName + ".pdf"
If InStr(StrFile, "_fmpro_temp") Then
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= StrPDFName, _
Quality:= xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
MsgBox StrName + " has been saved. " & vbNewLine & _
"If you're finished, please close the file," & vbNewLine & _
"and return to FileMaker to accept or discard this version.", _
vbInformation, "FileMaker Pro Versioning"
End If
End If
End Sub
If this is to be an Excel Add-in, then if you call
That will give you the directory to save add-ins to which will be something like: C:\Documents and Settings\Username\Application Data\Microsoft\AddIns\