Thema Datum  Von Nutzer Rating
Antwort
Rot Run-time error -2147467259 (80004005)
23.08.2021 15:02:19 Sinrow
NotSolved
23.08.2021 15:18:54 Gast72097
NotSolved
23.08.2021 15:21:32 Gast27942
NotSolved
23.08.2021 16:35:53 Sinrow
NotSolved
23.08.2021 16:51:10 Mase
NotSolved
23.08.2021 18:15:48 Sinrow
NotSolved
23.08.2021 19:04:55 Nicht-Mase
NotSolved
23.08.2021 19:06:54 NIcht-Nicht-Mase
NotSolved
24.08.2021 11:46:23 Sinrow
NotSolved
24.08.2021 12:18:51 Gast52811
NotSolved
24.08.2021 19:52:56 xlKing
NotSolved

Ansicht des Beitrags:
Von:
Sinrow
Datum:
23.08.2021 15:02:19
Views:
832
Rating: Antwort:
  Ja
Thema:
Run-time error -2147467259 (80004005)

Hey Leute,

habe ein kleines Problem mit dem unten stehenden VBA Code, welcher mich noch wahnsinnig macht. Bevor ich auf Windows 10 umgestiegen bin, hat alles noch einwandfrei geklappt. Immer wenn ich den Code ausfuehre, spuckt er mir folgenden Fehlercode aus.

Der Code soll vorliegende Excel-Diagramme in eine Powerpoint-Vorlage einfuegen bzw. die alten Diagramme in der PP mit denen aus der Excel zu ersetzen. Die Powerpointrefferenz in VBA ist gesetzt und sonst ist auf meinem Rechner alles up to date. Ich benutze Windows 10 und Excel sowie Powerpoint 2016.

Ich hoffe auf eure Hilfe :D

Der Code sieht wie folgt aus: 

Private Sub Workbook_Open() 

Dim sourceFileName As String 
Dim oldFilePath1 As String 
Dim newFilePath1 As String 
Dim oldFilePath2 As String 
Dim newFilePath2 As String 
Dim testnumber As String 

'The file name and path of the PowerPoint-file to update: 
      sourceFileName = ThisWorkbook.Sheets("Sheet1").Cells(1, 1).Value 

'The new file path as a string (the text to replace with) 
      newFilePath1 = ThisWorkbook.Sheets("Sheet1").Cells(6, 1).Value 
      testnumber = ThisWorkbook.Sheets("Sheet1").Cells(8, 1).Value 

If Len(newFilePath1) = 0 Then 

Else 
'Set the link to the Object Library: 
'Tools -> References -> Microsoft PowerPoint x.xx Object Library 

Select Case testnumber 

Case 1 
    oldFilePath1 = "D:\Users\187\Documents\Templates\_1\01_Ausgewertet.xls" 
Case 2 
    oldFilePath1 = "D:\Users\187\Documents\Templates\_2\01_Ausgewertet.xls" 
Case 3 
    oldFilePath1 = "D:\Users\187\Documents\Templates\_3\01_Ausgewertet.xls" 
Case 4 
    oldFilePath1 = "D:\Users\187\Documents\Templates\_4\01_Ausgewertet.xls" 
Case 5 
    oldFilePath1 = "D:\Users\187\Documents\Templates\_5\01_Ausgewertet.xls" 

End Select 

Dim pptApp As PowerPoint.Application 
Dim pptPresentation As Object 
Dim pptSlide As Object 
Dim pptShape As Object 

Dim StartTime As Double 
Dim SecondsElapsed As Double 

'Remember time when macro starts 
StartTime = Timer 

'Set the variable to the PowerPoint Application 
Set pptApp = New PowerPoint.Application 

'Make the PowerPoint application visible 
pptApp.Visible = True 

'Set the variable to the PowerPoint Presentation 
Set pptPresentation = pptApp.Presentations.Open(sourceFileName) 

' Round 1 for first Excel File 
'Loop through each slide in the presentation 
For Each pptSlide In pptPresentation.Slides 

    'Loop through each shape in each slide 
     For Each pptShape In pptSlide.Shapes 

        'Find out if the shape is a linked object or a linked picture 
         If pptShape.Type = msoLinkedPicture Or pptShape.Type _ = msoLinkedOLEObject Then 

            'Use Replace to change the oldFilePath to the newFilePath 
             pptShape.LinkFormat.SourceFullName = Replace(LCase _ (pptShape.LinkFormat.SourceFullName),  
             LCase(oldFilePath1), newFilePath1) 
         End If 
      Next 
Next 

pptPresentation.UpdateLinks 

'Save, close and quit the application 
pptPresentation.Save 
pptPresentation.Close 
pptApp.Quit 

'Release the memory 
Set pptApp = Nothing 
Set pptPresentation = Nothing 
Set pptSlide = Nothing 
Set pptShape = Nothing 

'Determine how many seconds code took to run 
SecondsElapsed = Round(Timer - StartTime, 2) 

' Clear Excel file to prevent from accidental start when opened later: ThisWorkbook.Sheets("Sheet1").Range("A1:A7").ClearContents 

End If 

End Sub

 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
Rot Run-time error -2147467259 (80004005)
23.08.2021 15:02:19 Sinrow
NotSolved
23.08.2021 15:18:54 Gast72097
NotSolved
23.08.2021 15:21:32 Gast27942
NotSolved
23.08.2021 16:35:53 Sinrow
NotSolved
23.08.2021 16:51:10 Mase
NotSolved
23.08.2021 18:15:48 Sinrow
NotSolved
23.08.2021 19:04:55 Nicht-Mase
NotSolved
23.08.2021 19:06:54 NIcht-Nicht-Mase
NotSolved
24.08.2021 11:46:23 Sinrow
NotSolved
24.08.2021 12:18:51 Gast52811
NotSolved
24.08.2021 19:52:56 xlKing
NotSolved