0

I have an OLE problem. I have written VBA code that's running an Excel Macro to update links to Excel objects within a PowerPoint presentation. The problem is that the update goes very slowly (it takes several minutes - sometimes as many as 30) when the PPT file being updated contains links to another Excel file that's in the same directory but isn't open. This condition causes PPT on opening to waste several minutes of time opening and closing the old Excel file to refresh links before the new Excel Macro takes over and powers through all of the links. When the file does not update links, it runs in 1-2 minutes. What I want to do is modify the code that first opens the PPT file so that it opens without updating OLE links.

The code I want to modify is in bold below:

Private Function OpenPresentation(sFileName As String) As Object

If sFileName <> "" Then
    If moPowerPointApp Is Nothing Then ' only create one PowerPoint Instance to save memory
        Set moPowerPointApp = CreateObject("PowerPoint.Application")
    End If
        
    **Set OpenPresentation = moPowerPointApp.Presentations.Open(sFileName)** 'open the powerpoint
    
    If OpenPresentation Is Nothing Then ' if it didn't open, show a message
        MsgBox "Unable to Open the specified PowerPoint file"
    End If
End If

End Function

I tried using a modifier (updateslinks:=0) I saw unline for not updating links automatically in Excel (below) but this doesn't work. I assume this is because the file being opened is a PPT, not an Excel file. I'd like to find a similar modifier that I can use so that when I open the PPT file, links are not updated.

Workbooks.Open Filename:=arrFiles(i), updatelinks:=0

0 Answers0