Mögliche Variante:
Sub RunExcelMakro()
Dim xlApp As Object
Dim xlWkb As Object
Dim sPfad As String
'Pfad zur ExcelDatei mit Makro
sPfad = "C:\Test\140220_Mappe.xlsm"
'Excel starten
Set xlApp = CreateObject(class:="Excel.Application")
'Excel = sichtbar
xlApp.Visible = True
'Arbeitsmappe laden
Set xlWkb = xlApp.Workbooks.Open(sPfad)
'Makro ausfürhen
xlApp.Run "Bild_als_Grafik_speichern"
'Arbeitsmappe speichern und schließen
xlWkb.Close SaveChanges:=True
'Excel schließen
xlApp.Quit
'
Set xlWkb = Nothing: Set xlApp = Nothing
End Sub
Hinweis:
-ohne grossartige Fehlerbehandlung
- Es wird davon ausgegangen, dass Datei existiert, nicht offen ist usw
|