method 'range' of object '_global' failed

S

Schades

I get the error: Method 'Range' of object '_glogal' failed

I run the following call files code and it is giving me an error around
CStr(Range("PropCode1").Value).

Below is the table it references to pull the files. All files are
spelled correctly.

Counter1 1
TotCount1 106
PropCode1 AL


Sub CallFiles()

ChDir "C:\Documents and Settings\user"

Dim i As Integer
Dim strFileName As String
strFileName = CStr(Range("PropCode1").Value) & "-Budget06.xls"
Application.DisplayAlerts = False


' loop thru all the properties on the Props sheet
For i = 1 To CStr(Range("TotCount1").Value)
Range("Counter1") = i
Calculate
strFileName = CStr(Range("PropCode1").Value) & "-Budget06.xls"

FINAL_CORRECTIONS

Next i


End Sub

2nd MACRO [first few lines]:

Sub FINAL_CORRECTIONS()


Dim i As Integer
Dim strFileName As String
strFileName = CStr(Range("PropCode1").Value) & "-Budget06.xls"
Application.DisplayAlerts = False


ChDir "C:\Documents and Settings\user"
Workbooks.Open strFileName

FilePass = Sheets("DATASHEET").Range("E1")
Sheets("Corporate").Select
Range("H7").Select
ActiveSheet.Unprotect Password:=CStr(Range("FilePass"))
ActiveWorkbook.Unprotect Password:=CStr(Range("FilePass"))
Sheets("DATASHEET").Visible = True
ActiveWindow.LargeScroll ToRight:=-1
Sheets("DATASHEET").Select
Range("J7").Select
ActiveCell.FormulaR1C1 = "0%"
Range("J8").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Calc Sheet").Visible = True
....
 
J

Jim Rech

Range("PropCode1").Value

The above giving a range method failed error is a strong indication that
that range does not exist on the active worksheet. Does that name appear in
the the Define Name dialog when you press Ctrl-F3?
 
G

Guest

Hi

I have found that quite a few problems can arise when ranges are not
qualified. Try qualifying them with the names of the worksheets.

Alok
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top