I don't know if a new thread should be started or not, but I still can't run macros from Access, although when Access opens up the workbook through Excel the macros show up in the modules.
Keep getting error message "run-time error '1004':"
Cannot run the macro 'C:\Program Files\Microsoft Office\Office14\XLSTART\Personal.xlsm!Macro1'. The macro may not be available in this workbook or all macros may be disabled.
Again, my macro security settings have been completely lowered, they show up in the document, and using this code:
Code:
Function Macro22()
On Error GoTo Macro22_Err
Dim appExcel1 As Excel.Application
On Error Resume Next
AppActivate "Microsoft Excel"
If Err Then
Shell "c:\Program Files\Microsoft Office\Office\" _
& "Excel /Automation", vbHide
AppActivate "Microsoft Excel"
End If
On Error GoTo 0
Set appExcel1 = GetObject(, "Excel.Application")
appExcel1.Workbooks.Open FileName:="c:\pmi\temp3.xlsx"
strXLSMPath = "c:\PMI\temp3.xlsm"
strCSVPath = "c:\PMI\temp1.csv"
appExcel1.ActiveWorkbook.SaveAs FileName:=Left(strXLSMPath, Len(strCSVPath) - 3) & "xlsm" _
, FileFormat:=52
appExcel1.Workbooks.Open FileName:="c:\pmi\temp3.xlsm"
appExcel1.Application.Run "C:\Program Files\Microsoft Office\Office14\XLSTART\Personal.xlsm!Macro1"
Macro22_Exit:
Exit Function
Macro22_Err:
MsgBox Error$
Resume Macro22_Exit
End Function
(forgive the laziness on replacing some variables here, for example we're no longer using CSV files just changing an XLSX file to an XLSM file)
the macro is stored in the template file of course. Temp1,2 and 3 are basically made from scratch.