Opening Embedded PDF File causes delay before opening again

bisel

Board Regular
Joined
Jan 4, 2010
Messages
249
Office Version
  1. 365
Platform
  1. Windows
Greetings,

With the help of users here on this forum, I have been able to use VBA to open an embedded file. Here is the code I am using for the macro ...

VBA Code:
Sub getstarted()
    
' If any error resume next.  Need this in case user does not have the 32Bit or 64Bit version of Adobe Reader
    On Error Resume Next
    
    Sheet5.OLEObjects("getting_started").Verb Verb:=xlVerbOpen
    Sheet16.Select
    
' Use AppActivate to bring Acrobat Reader to the front, make sure to trap the error if user does not specific version of reader
    AppActivate "Adobe Acrobat Reader DC (64-bit)", True
    AppActivate "Adobe Acrobat Reader DC (32-bit)", True
    
On Error GoTo 0
    
End Sub

I have several embedded PDF files and I use the same code for each, changing only the PDF file name.

When I initiate the macro, the PDF file opens as expected. If I immediately close the file and try to open that same or initiate one of the other macros, there is no response. I must wait a few seconds before I can initiate that macro again.

Does anyone know what this delay is?

Regards,

Steve
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top