View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Search and open feature

Tom,
Well which error are you getting ?
Also what is the value of Range("C3").Text, as there is no obvious value
from your jpg.

NickHK

"TomBP" wrote in
message ...

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