View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
TomBP[_3_] TomBP[_3_] is offline
external usenet poster
 
Posts: 1
Default Search and open feature


The pictures speak for themselves:

[image: http://i54.photobucket.com/albums/g1...BP/Pic1-4.jpg]

[image: http://i54.photobucket.com/albums/g1...BP/Pic2-3.jpg]

I already tried to fix this using the following macro but no success


Code:
--------------------
Sub OpenWorkbook()
Dim s1 as String, bk as Workbook, bk1 as Workbook
s1 = "C:\Documents and Settings\" & _
"fackt0\Desktop\Shipments\"

set bk = activeWorkbook
if dir(s1 & Range("C3").Text & ".xls") < "" then
set bk1 = Workbooks.Open(s1 & Range("J5").Text & ".xls")
bk.Activate
else
msgbox "workbook not found"
End if
End sub
--------------------


Anyone with an idea what might be wrong?


--
TomBP
------------------------------------------------------------------------
TomBP's Profile: http://www.excelforum.com/member.php...o&userid=36112
View this thread: http://www.excelforum.com/showthread...hreadid=559237