Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error Method Cell of object global failure
I'm experiencing this error (Method - 'Cell ' of object -
Global failure) after running through the routine twice. On the first run, this error is not encountered. This code is run from Access 2000: HeadingArr = Array("Negotiated Current","Actual Current", _ "Negotiated ITD", "Actual ITD") For i = 2 to 11 Step 3 Set oRange = oSheet.Range(Cells(1,i), Cells(1, i + 2)) With oRange .MergeCell = True .Value = HeadingArr(Init((i+1) 3)) end with next |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error Method Cell of object global failure
Hi Marilyn,
The only thing that jumps out immediately is that you might be doing something that activates a different worksheet than the one your oSheet variable refers to in between runs. In this case, the oSheet.Range and the unqualified Cells method are referring to ranges on two different worksheets. Try it like this and see if it fixes the problem: Set oRange = oSheet.Range(oSheet.Cells(1,i), oSheet.Cells(1, i + 2)) -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "Marilyn" wrote in message ... I'm experiencing this error (Method - 'Cell ' of object - Global failure) after running through the routine twice. On the first run, this error is not encountered. This code is run from Access 2000: HeadingArr = Array("Negotiated Current","Actual Current", _ "Negotiated ITD", "Actual ITD") For i = 2 to 11 Step 3 Set oRange = oSheet.Range(Cells(1,i), Cells(1, i + 2)) With oRange .MergeCell = True .Value = HeadingArr(Init((i+1) 3)) end with next |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
error message Method €˜Add of object €˜CommandBar Controls fail? | Excel Discussion (Misc queries) | |||
runtime error 434, object does not support this method or property | Excel Discussion (Misc queries) | |||
Intermittent Error - Method 'Add' of object 'HPageBreaks' failed | Excel Worksheet Functions | |||
Object doesn't support this property or method (Error 438) | Excel Discussion (Misc queries) | |||
Error 1004: Method 'Cells' of object '_Global' failed | Excel Programming |