View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default VBA to search for possible files in Windows Explorer

Hi Frank,

Am Fri, 25 Sep 2015 10:50:31 -0400 schrieb Phrank:

My current code is below. Thanks for any help or advice.

Dim LotSNnum As Long
Dim wePath As String

wePath = "\\server.company.path\DHR\"

Range("E13").NumberFormat = "@"
LotSNnum = Mid(Range("E13").Value, 1, 8)

Shell "C:\WINDOWS\explorer.exe """ & wePath & LotSNnum, vbNormalFocus


try it with xlDialogOpen:
(Modify wePath to your Path)

Sub Test()
Dim wePath As String
Dim LotsNnum As String

wePath = "H:\Test\"
LotsNnum = Mid(Range("E13").Value, 1, 8)

Application.Dialogs(xlDialogOpen).Show (wePath & LotsNnum & "*.pdf")
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional