PC Review


Reply
Thread Tools Rate Thread

ActiveWorkbook.Sheets.Select

 
 
=?Utf-8?B?U3RlcGhhbmllSA==?=
Guest
Posts: n/a
 
      22nd Aug 2007
I'm trying to select all sheets in my workbook. In the past, I've always
used ActiveWorkbook.Sheets.Select. For some reason, this time I'm getting
"Run-time error '1004'". I've never seen this in the past.

Any other ways to select all sheets? Anyone have an idea why it would work
in other workbooks, but not this one?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?U3lzQWNjb3VudGFudA==?=
Guest
Posts: n/a
 
      22nd Aug 2007
It would appear to be an anomaly

If it 's preventing you from continuing ,just simply code it into an error
handler.

For Example :
On Error goto err_Handler


....code etc


err_Handler:

If err. number = 1004 then

Exit Sub

End if



HTH


Regards

SysAccountant


"StephanieH" wrote:

> I'm trying to select all sheets in my workbook. In the past, I've always
> used ActiveWorkbook.Sheets.Select. For some reason, this time I'm getting
> "Run-time error '1004'". I've never seen this in the past.
>
> Any other ways to select all sheets? Anyone have an idea why it would work
> in other workbooks, but not this one?

 
Reply With Quote
 
=?Utf-8?B?U3RlcGhhbmllSA==?=
Guest
Posts: n/a
 
      22nd Aug 2007
That somewhat worked. It would allow me to skip the step, but obviously it
messes up everything that takes place after that since it was a necessary
step. I ended up just rerecording the piece to select each sheet through an
array.


"SysAccountant" wrote:

> It would appear to be an anomaly
>
> If it 's preventing you from continuing ,just simply code it into an error
> handler.
>
> For Example :
> On Error goto err_Handler
>
>
> ...code etc
>
>
> err_Handler:
>
> If err. number = 1004 then
>
> Exit Sub
>
> End if
>
>
>
> HTH
>
>
> Regards
>
> SysAccountant
>
>
> "StephanieH" wrote:
>
> > I'm trying to select all sheets in my workbook. In the past, I've always
> > used ActiveWorkbook.Sheets.Select. For some reason, this time I'm getting
> > "Run-time error '1004'". I've never seen this in the past.
> >
> > Any other ways to select all sheets? Anyone have an idea why it would work
> > in other workbooks, but not this one?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select the same cell in sheets 2 & sheets 3 Oggy Microsoft Excel Programming 0 8th Jan 2007 08:02 PM
Adding a sheets name to the worksheets that are copied over from an addin file to the activeworkbook KimberlyC Microsoft Excel Programming 2 7th May 2005 04:10 AM
ActiveWorkbook.Sheets.Count =?Utf-8?B?SmFjIFRyZW1ibGF5?= Microsoft Excel Programming 7 10th Nov 2004 06:22 AM
From my Addin, referring to activeworkbook's sheets by their codenames Dianne Microsoft Excel Programming 5 27th Aug 2003 04:36 PM
select sheets by name - how? Walt Microsoft Excel Programming 5 30th Jul 2003 10:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:07 PM.