Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Method 'Columns' of object '_Global' failed

In a normal Sub in a normal module (not run via automation) I have this line
of code:
Columns(8).NumberFormat = "@"
Actually it is:
3260 Columns(8).NumberFormat = "@"
As I have line numbering for error handling.

It works fine on my machine (Excel 11, Windows XP) but I got a message from
one user
where this line fails with: Method 'Columns' of object '_Global' failed
This is also in Excel 11, not sure about the OS.
Why could this be?

If I record selecting a column I get: Columns("E:E").Select
and Columns is a member of globals in the object browser.
Should I do: ActiveSheet.Columns(8) ?

Thanks for any insight in this.

RBS



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Method 'Columns' of object '_Global' failed

Being that it is in a normal module it will by default be running against the
active sheet. If the active sheet at the time is a Chart sheet and not a
regular worksheet you will generate the error posted. Columns is not a
property of method of a chart sheet... That's my best guess...
--
HTH...

Jim Thomlinson


"RB Smissaert" wrote:

In a normal Sub in a normal module (not run via automation) I have this line
of code:
Columns(8).NumberFormat = "@"
Actually it is:
3260 Columns(8).NumberFormat = "@"
As I have line numbering for error handling.

It works fine on my machine (Excel 11, Windows XP) but I got a message from
one user
where this line fails with: Method 'Columns' of object '_Global' failed
This is also in Excel 11, not sure about the OS.
Why could this be?

If I record selecting a column I get: Columns("E:E").Select
and Columns is a member of globals in the object browser.
Should I do: ActiveSheet.Columns(8) ?

Thanks for any insight in this.

RBS




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Method 'Columns' of object '_Global' failed

Yes, that is the only thing I can think of.
Or, as this code is in an add-in it could be that no workbook is open, so
there
is no sheet at all.
Waiting for confirmation from this customer.

RBS


"Jim Thomlinson" wrote in message
...
Being that it is in a normal module it will by default be running against
the
active sheet. If the active sheet at the time is a Chart sheet and not a
regular worksheet you will generate the error posted. Columns is not a
property of method of a chart sheet... That's my best guess...
--
HTH...

Jim Thomlinson


"RB Smissaert" wrote:

In a normal Sub in a normal module (not run via automation) I have this
line
of code:
Columns(8).NumberFormat = "@"
Actually it is:
3260 Columns(8).NumberFormat = "@"
As I have line numbering for error handling.

It works fine on my machine (Excel 11, Windows XP) but I got a message
from
one user
where this line fails with: Method 'Columns' of object '_Global' failed
This is also in Excel 11, not sure about the OS.
Why could this be?

If I record selecting a column I get: Columns("E:E").Select
and Columns is a member of globals in the object browser.
Should I do: ActiveSheet.Columns(8) ?

Thanks for any insight in this.

RBS





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 Graham Excel Programming 4 November 6th 06 08:33 PM
Method 'Range' of object '_global' failed higherlimits Excel Discussion (Misc queries) 3 June 23rd 06 06:16 PM
method 'range' of object '_global' failed Schades Excel Programming 2 October 27th 05 01:37 AM
Method 'Intersect' of object '_Global' failed Josh Sale Excel Programming 3 June 17th 04 05:27 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 11:31 PM.

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"