Tom,
Yes, look:
> Sub Macro1() <<<<<<<<< 1 sub
> '
> ' Macro1 Macro
> ' Macro recorded 4/07/2006 by BPPassPort User
> '
> ' Keyboard Shortcut: Ctrl+t
> '
>
> Sub OpenWorkbook() <<<<<<<<< 2 sub
NickHK
"TomBP" <TomBP.2akkln_1152266106.7538@excelforum-nospam.com> wrote in
message news:TomBP.2akkln_1152266106.7538@excelforum-nospam.com...
>
> This is another macro I use for another sheet. This works fine and I see
> no difference in standard lines with the macro which isn't working
>
>
> Code:
> --------------------
> Sub Macro2()
> '
> ' Macro2 Macro
> ' Macro recorded 4/07/2006 by BPPassPort User
> '
> ' Keyboard Shortcut: Ctrl+t
> '
> Dim s As String, s1 As String
> s = ActiveSheet.Range("F10").Text
> s1 = "C:\Documents and Settings\" & _
> "fackt0\Desktop\Excel probleem\Shipments\"
> ActiveWorkbook.SaveAs _
> Filename:=s1 & s & ".xls", _
> FileFormat:=xlNormal, _
> Password:="", _
> WriteResPassword:="", _
> ReadOnlyRecommended:=False, _
> CreateBackup:=False
> End Sub
> --------------------
>
>
>
> This is the macro which isn't working again.
>
>
> Code:
> --------------------
> Sub Macro1()
> '
> ' Macro1 Macro
> ' Macro recorded 4/07/2006 by BPPassPort User
> '
> ' Keyboard Shortcut: Ctrl+t
> '
>
> 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
> --------------------
>
>
> --
> TomBP
> ------------------------------------------------------------------------
> TomBP's Profile:
http://www.excelforum.com/member.php...o&userid=36112
> View this thread: http://www.excelforum.com/showthread...hreadid=559237
>
Bookmarks