Link to home
Start Free TrialLog in
Avatar of Phil
PhilFlag for United States of America

asked on

Problems with opening files via VBA Shell command

I have an Access front-end / SQL Server back-end application opening PDF files via VBA Shell command. It worrks on most systems but one workstation is not working. To test this, I created a small sub to try opening a Word document as I wasn't sure if it was an Adobe reader issue or something else. When I execute the routine pasted below we get a message that the file can't be found and it tries to open two files if there is a space in the file name. When trying to open a PDF shelling the Acrord32.exe the messages says access denied.

My client is busy now but I can provide more detailed error messages later today.

Sub bloc()

Dim s As Variant
Dim i As Integer


s = Shell("C:\Program Files (x86)\Microsoft Office\Office15\WINWORD.EXE D:\daily\test document.docx")
End Sub
SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Phil

ASKER

OK, when my client calls me back I'll give this a shot. I assume the only changes are the extra double quotes? """ etc.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial