Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default method 'range' of object '_global' failed

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
....

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default method 'range' of object '_global' failed

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?

--
Jim
"Schades" wrote in message
oups.com...
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
...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default method 'range' of object '_global' failed

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

"Schades" wrote:

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
....


Reply
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
Method 'Range' of object '_global' failed higherlimits Excel Discussion (Misc queries) 3 June 23rd 06 06:16 PM
Method Range of object '_Global' failed maverick2005 Excel Programming 3 August 25th 05 02:56 PM
What does XLS VB Method 'Range of object' _Global failed mean? DCMKGG Excel Programming 2 February 25th 05 03:06 PM
Method 'Range' of object '_Global' failed Brian Morris[_2_] Excel Programming 1 December 10th 03 11:04 PM
Method 'Range' of object '_Global' failed Mohanasundaram[_2_] Excel Programming 1 August 25th 03 01:43 PM


All times are GMT +1. The time now is 01:13 AM.

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

About Us

"It's about Microsoft Excel"