PC Review


Reply
Thread Tools Rate Thread

Code won't work if activesheet is a Chart Sheet

 
 
Barry Pettis
Guest
Posts: n/a
 
      16th Sep 2004
I have an issue with an XL macro that will work only if the activesheet
is not a chartsheet. I've posted a question on the OzGrid.com ( Please
see thread at following link )

http://ozgrid.com/forum/showthread.p...2&page=2&pp=10

I'm wondering if someone can explain to me why the code errors if the
active sheet is a chart sheet and will work fine if the active sheet is
a worksheet.


Regards,
Barry

** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins & Software!
http://www.ozgrid.com/Services/excel...categories.htm **
 
Reply With Quote
 
 
 
 
Jack Schitt
Guest
Posts: n/a
 
      16th Sep 2004
Just a guess, but have you tried

Sheets(strSortThisPage)

instead of where you put

Worksheets(strSortThisPage)

?

"Barry Pettis" <(E-Mail Removed)> wrote in message
news:41493d0e$0$26163$(E-Mail Removed)...
> I have an issue with an XL macro that will work only if the activesheet
> is not a chartsheet. I've posted a question on the OzGrid.com ( Please
> see thread at following link )
>
> http://ozgrid.com/forum/showthread.p...2&page=2&pp=10
>
> I'm wondering if someone can explain to me why the code errors if the
> active sheet is a chart sheet and will work fine if the active sheet is
> a worksheet.
>
>
> Regards,
> Barry
>
> ** Posted via: http://www.ozgrid.com
> Excel Templates, Training, Add-ins & Software!
> http://www.ozgrid.com/Services/excel...categories.htm **



 
Reply With Quote
 
Barry Pettis
Guest
Posts: n/a
 
      16th Sep 2004
Just tried last suggestion and it failed. Same error "Type Mismatch".


Again works fine with change as long as the active sheet is Not a chart
sheet????


This is baffling me!!!!

** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins & Software!
http://www.ozgrid.com/Services/excel...categories.htm **
 
Reply With Quote
 
Paulw2k
Guest
Posts: n/a
 
      16th Sep 2004
Barry,

Your activesheet is a chart-sheet and you are trying to do something that
can only be done on a worksheet.

The sheets collection is made up of worksheets, chart sheets,
Excel4MacroSheets; each with their own particular
properties and methods.

So if you know that there are chart sheets in the activeworkbook, rather
than bog standard worksheets then tailor your code
accordingly.

If TypeName(ActiveSheet) = "Chart" then .....

If TypeName(ActiveSheet) = "Worksheet" then .....


Regards

Paul

"Barry Pettis" <(E-Mail Removed)> wrote in message
news:41493d0e$0$26163$(E-Mail Removed)...
>I have an issue with an XL macro that will work only if the activesheet
> is not a chartsheet. I've posted a question on the OzGrid.com ( Please
> see thread at following link )
>
> http://ozgrid.com/forum/showthread.p...2&page=2&pp=10
>
> I'm wondering if someone can explain to me why the code errors if the
> active sheet is a chart sheet and will work fine if the active sheet is
> a worksheet.
>
>
> Regards,
> Barry
>
> ** Posted via: http://www.ozgrid.com
> Excel Templates, Training, Add-ins & Software!
> http://www.ozgrid.com/Services/excel...categories.htm **



 
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
Check Activesheet for chart sheet or work sheet =?Utf-8?B?TlNL?= Microsoft Excel Charting 1 17th Jul 2007 09:00 PM
What was ActiveSheet before changed to new sheet? Tom L Microsoft Excel Programming 5 12th Sep 2006 02:22 PM
Copied chart should link to the new work sheet =?Utf-8?B?U2hhd25aIGZyb20gQU4=?= Microsoft Access 1 18th Jul 2006 09:49 PM
Chart versus Work Sheet Code Failure Nigel Microsoft Excel Programming 2 18th Apr 2005 05:16 PM
activesheet: chart or worksheet? mfp Microsoft Excel Programming 2 28th May 2004 02:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:29 AM.