Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question Open Shellling to File Explorer

Status
Not open for further replies.

rdpress

Technical User
Aug 16, 2002
24
0
1
US

I am trying to create a pdf from a report and then open file explorer with the report selected within explorer - user will then drag and drop the report to a third party web-site.
All went well.

However now file explorer opens as an icon in the taskbar - clicking on it opens the window will open with the correct file selected, but I have no idea why file explorer does not open
the window directly --- it had been doing so and I do not remember making any changes.


here's the code:
DoCmd.OutputTo acReport, stDocName, acFormatPDF, stOutPutFile, False
Shell "C:\WINDOWS\explorer.exe /n, /select, """ & stOutPutFile & " ", vbNormalFocus
Thanks Much!

 
Do you have any lines of code after:[tt]
Shell "C:\WINDOWS...
[red]???[/red][/tt]

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
I do not... except for an "Endif"
 
I did try your code yesterday, it worked first time around, and then it did not. :-(
I tried it again today:

Code:
Option Explicit
Sub Test()
Dim stOutPutFile As String
stOutPutFile = "C:\Andy\Tips\MSForms.Control.txt"
Shell "C:\WINDOWS\explorer.exe /n, /select, """ & stOutPutFile & " ", vbNormalFocus
End Sub

And it works every time as expected. [surprise]

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top