Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default 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
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
error message Method €˜Add of object €˜CommandBar Controls fail? Sandy Pringle Excel Discussion (Misc queries) 2 October 30th 09 02:45 PM
runtime error 434, object does not support this method or property Janis Excel Discussion (Misc queries) 4 January 17th 08 04:10 PM
Intermittent Error - Method 'Add' of object 'HPageBreaks' failed Jamey Weare Excel Worksheet Functions 1 December 22nd 06 01:40 AM
Object doesn't support this property or method (Error 438) Kiran Excel Discussion (Misc queries) 1 July 12th 05 08:42 PM
Error 1004: Method 'Cells' of object '_Global' failed LT Excel Programming 2 October 31st 03 04:47 PM


All times are GMT +1. The time now is 06:19 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"