Zum Inhalt springen

derArb

Mitglieder
  • Gesamte Inhalte

    1
  • Benutzer seit

  • Letzter Besuch

  1. Hallo Profis, Der folgende Code funktioniert zwar in ACCESS2002, aber ich muss dabei immer 2 x die Excelapplication aufrufen, um die Pfadänderung in Excel zu bekommen. Bei einmaligem Aufruf ändert sich der Pfadname nicht in Excel. Erst wenn ich das Workbook schliesse und nochmal über die Automatisierung aufrufe. Hängt das damit zusammen, dass ich ein template aufrufe? Kann mir jemand dabei bitte helfen? mfg derArb Private Sub calculation_Click() Dim objXLApp As excel.Application Dim objXLWkb As excel.Workbook Dim objXLWks As excel.Worksheet Dim xltemplate As String Set objXLApp = CreateObject("Excel.Application") xltemplate = Forms!userdaten.excelpfad & "\" & Me![Prod-Titel] & "\" & "templates" & "\" & "calculation.xlt" Set objXLWkb = objXLApp.Workbooks.Add(Template:=xltemplate) objXLApp.DefaultFilePath = Forms!userdaten.excelpfad & "\" & Me![Prod-Titel] objXLApp.DisplayAlerts = False objXLApp.Quit objXLApp.DisplayAlerts = True Set objXLWks = Nothing Set objXLWkb = Nothing Set objXLApp = Nothing Set objXLApp = CreateObject("Excel.Application") xltemplate = Forms!userdaten.excelpfad & "\" & Me![Prod-Titel] & "\" & "templates" & "\" & "calculation.xlt" Set objXLWkb = objXLApp.Workbooks.Add(Template:=xltemplate) objXLApp.DefaultFilePath = Forms!userdaten.excelpfad & "\" & Me![Prod-Titel] objXLApp.Visible = True Set objXLWks = Nothing Set objXLWkb = Nothing Set objXLApp = Nothing End Sub

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...