LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Runtime Error - Method 'Cells' of Object'_Global' Failed

Jon --

Thanks so much for the quick response! I set up the code as you suggested:

Sub Trendline_Update()
'
' Trendline_Update Macro
' Macro recorded 8/30/2001

current_column = 18
current_row = 3
end_row = 15
ActiveWorkbook.Worksheets("Trendline Chart").Cells(1, 1).Select

But it stops on the ActiveWorkbook line with a "Select Method of Range Class
Failed" error.

The original code looked like this:

current_column = 18
current_row = 3
end_row = 15
Sheets("Trendline Chart").Select
Cells(1, 1).Select

Thanks,

Val

"Jon Peltier" wrote:

Cells.(1, 1).Select

should be

Cells(1, 1).Select

To make it more robust, you should specify a sheet in front of Cells,
something like:

ActiveWorkbook.Worksheets("Sheet1").Cells(1, 1).Select

Generally Excel assumes the active sheet, but if the active sheet is a chart
sheet, you're hosed. And I'd rather specify something than let Excel assume
it knows what I want.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"vsingler" wrote in message
...
We have an Excel macro that was written several versions of Excel back (by
someone who is no longer with the company) which is now showing a runtime
error - Method 'Cells" of Object'_Global Failed when run by Excel 2003.
The
line in the code that creates the error is written as Cells.(1, 1).Select.
At
first the code failed in Excel 2002 as well, but I created a new module
and
copied the code in from a working clone of the workbook (after removing
the
old module) and it seemed to correct the problem. When I returned the file
to
the Excel 2003 user, it failed.

I'm anticipating seeing this failure come up in the future as we continued
to update to 2003 and eventually 2007. I would appreciate any guidance as
to
whether the syntax of the Cells.(1, 1).Select line should be changed (and
to
what), or what else I should be looking at to correct the problem.

Thank you, in advance, for any help you can provide.




 
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
Dynamic chart generation: Run time Error '1004: Method 'Cells' of object'_Global' fai Ajay_N Charts and Charting in Excel 1 August 15th 06 03:54 AM
Run time Error '1004: Method 'Cells' of object'_Global' failed Ajay_N[_2_] Excel Programming 0 August 12th 06 04:57 AM
method 'range' of object'_global' failed cedtech23[_16_] Excel Programming 2 July 21st 06 02:19 AM
Help: runtime error - Method seriescollection object_chart failed huangx06 Charts and Charting in Excel 3 July 9th 05 12:27 AM
Method 'Range" of object'_Global' failed Tim Excel Programming 2 February 23rd 04 08:37 PM


All times are GMT +1. The time now is 07:00 AM.

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

About Us

"It's about Microsoft Excel"