Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Windows Explorer and select item
Is there any programmatic way to instantiate Windows explorer, and point it
to a path (without using IE)? If so, is it further possible to then select an item in that instance, showing the user where a particular file is? Any help would be greatly appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Windows Explorer and select item
This is some code I used to get to a specific path. It may not be exactly
what you want, but you get the idea. I'm not sure if you can add the filename or not, give it a try and let me know your results Dim path1 As String, path2 As String Dim fs As Object Dim temp as Variant Set fs = CreateObject("Scripting.FileSystemObject") path1 = "G:\path1\" & ActiveCell.Value path2 = "G:\path2\" & ActiveCell.Value Select Case "True" Case fs.folderexists(path1) temp = Shell("EXPLORER.EXE /e,/root," & path1, vbNormalFocus) Case fs.folderexists(path2) temp = Shell("EXPLORER.EXE /e,/root," & path2, vbNormalFocus) Case Else MsgBox ("Folder " & ActiveCell.Value & " does not exist") End Select End Sub "R Avery" wrote in message ... Is there any programmatic way to instantiate Windows explorer, and point it to a path (without using IE)? If so, is it further possible to then select an item in that instance, showing the user where a particular file is? Any help would be greatly appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Windows Explorer and select item
Why not use the file open dialog:
chdrive "C" ChDir "C:\My documents" fname = Application.GetOpenFileName() -- Regards, Tom Ogilvy R Avery wrote in message ... Is there any programmatic way to instantiate Windows explorer, and point it to a path (without using IE)? If so, is it further possible to then select an item in that instance, showing the user where a particular file is? Any help would be greatly appreciated. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Windows Explorer and select item
Thank you for this. It instantiates the windows explorer and goes to the
appropriate directory. However, is it possible to then select an item in that window to point the user to the correct document? The reason i do not want to use file open dialog is that these files will not be Excel files... they will be a combination of either: PDFs, DOCs, TXTs, or TIFs. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Windows Explorer and select item
One more thing. In the SHELL function you gave me, what does the
"\e,\root," do? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Windows Explorer and select item
I would recommend you check out the Microsoft knowledge base at the
following link http://support.microsoft.com/default...Product=wd2002 watch for word wrap the article q130510 talks about the command-line switches for explorer. The /e switch tells explorer to open in explorer view and the /root switch specifies the root level folder to view. There is a switch /select which allows sub object selection but I'm not sure if that is just for folders or allows file also. Give it a try Paul D "R Avery" wrote in message ... One more thing. In the SHELL function you gave me, what does the "\e,\root," do? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Windows Explorer and select item
Well if I would have read the examples at the bottom I would have seen you
can select a file as per this example explorer /select,c:\windows\calc.exe Paul D "Paul D" wrote in message ... I would recommend you check out the Microsoft knowledge base at the following link http://support.microsoft.com/default...Product=wd2002 watch for word wrap the article q130510 talks about the command-line switches for explorer. The /e switch tells explorer to open in explorer view and the /root switch specifies the root level folder to view. There is a switch /select which allows sub object selection but I'm not sure if that is just for folders or allows file also. Give it a try Paul D "R Avery" wrote in message ... One more thing. In the SHELL function you gave me, what does the "\e,\root," do? |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Windows Explorer and select item
Perfect! Thank you so much, Paul. ;D
"Paul D" wrote in message ... Well if I would have read the examples at the bottom I would have seen you can select a file as per this example explorer /select,c:\windows\calc.exe Paul D "Paul D" wrote in message ... I would recommend you check out the Microsoft knowledge base at the following link http://support.microsoft.com/default...Product=wd2002 watch for word wrap the article q130510 talks about the command-line switches for explorer. The /e switch tells explorer to open in explorer view and the /root switch specifies the root level folder to view. There is a switch /select which allows sub object selection but I'm not sure if that is just for folders or allows file also. Give it a try Paul D "R Avery" wrote in message ... One more thing. In the SHELL function you gave me, what does the "\e,\root," do? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can not open .xls files via Windows Explorer | Excel Discussion (Misc queries) | |||
File Open Vs Opening from Windows Explorer | Excel Discussion (Misc queries) | |||
Open Excel 2003 from Windows Explorer | Excel Discussion (Misc queries) | |||
Excel files won't open from Windows Explorer | Excel Discussion (Misc queries) | |||
windows explorer will not open an excel spreadsheet. | Excel Discussion (Misc queries) |