-
Waiting for PDF to load
Hello, hoping you guys can help. I think it may be real simple.
This code loads a PDF into the form, and it takes up to a second to load.
I want the "OK" button to be in focus, but usually the PDF finishes loading after the message box appears and takes the focus.
The only work around I could think of was "Me.Wait (1)" which is just not a good way about it.
[vba]
wb1.Navigate filname
Me.Wait (1)
MsgBox "Please update the Date Received.", vbOKOnly + vbSystemModal + vbDefaultButton1
txtDRMM.SetFocus
[/vba]
Any ideas?
-
Are you using Adobe Acrobat to view the PDF? Unfortunately it is very slow loading.
What control are you using on the form to display the PDF?
-
Well, I did not originally create the code, but I am learning VBA as I go.
The form object's class is Shell.Explorer.2, if that helps, and it does load with Adobe Acrobat.
Is there something other info specifically I could give you that would help more?
-
You speed issue is Adobe Acrobat. it is well know to be very slow to load.
I use Nitro Reader. There is a free and Pro versions. It loads a lot faster that Adobe's.