![]() |
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 |
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 |
All times are GMT +1. The time now is 03:46 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com