LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Script out of range

I have the following code:

Sub ReturnToBldrsEst()
Dim wbfilename As String

Call checkworkbook
wbfilename = Worksheets("Current DB").Range("currentwb")
Workbooks(wbfilename).Activate

End Sub
Sub checkworkbook()
Dim wb As Workbook
Dim wbopen As Boolean
Dim wbfilename As String

wbopen = False
wbfilename = Worksheets("Current DB").Range("currentwb")

If wbfilename < "" Then
For Each wb In Application.Workbooks
If wb.FullName = wbfilename Then
wbopen = True
End If
Next
End If
If wbopen = False Then
Workbooks.Open (wbfilename)
End If
End Sub

On the line with "Workbooks(wbfilename).Activate" I get a script out of
range error. wbfilename =C:\Documents and Settings\Randy\Desktop\Builders
Estimator.xls

What am I doing wrong here?
Thanks

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script out of range J Excel Programming 7 April 11th 08 10:09 PM
Script out of range J Excel Programming 3 April 11th 08 09:05 PM
Range Syntax for Script [email protected] Excel Programming 3 June 21st 07 06:34 PM
sub script out of range problem AmyTaylor[_20_] Excel Programming 5 July 27th 05 12:17 AM
Script out of range error [email protected] Excel Programming 5 May 24th 05 09:37 PM


All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"