Greetings,
You know there are two type of sheets.
1- Worksheet
2- Chartsheet
Open enclosed file and run Macro1.
Why Chartsheet can not be deleted ?Please Login or Register to view this content.
Regards
Greetings,
You know there are two type of sheets.
1- Worksheet
2- Chartsheet
Open enclosed file and run Macro1.
Why Chartsheet can not be deleted ?Please Login or Register to view this content.
Regards
Sub DontForgetThese() If Your thread includes any code Then Please use code tags... If Your thread has been solved Then Please mark as solved... If Anybody has helped to you Then Please add reputation... End Sub
Please Login or Register to view this content.
I think you are confusing the "worksheets" collection (http://msdn.microsoft.com/en-us/libr...ice.15%29.aspx ) that contains all the "worksheet" objects in a workbook and the "sheets" collection (http://msdn.microsoft.com/en-us/libr...ice.15%29.aspx ) which contains both chart sheets and worksheets. Conceptually, it seems like it should work if you adjust the code to use the sheets collection.
Originally Posted by shg
Hi AB33,
Thanks for the code.
Last edited by HerryMarkowitz; 08-11-2014 at 06:14 PM.
Hi MrShorty,
Yes you are right.
I was confusing sheet and worksheet.
But now I understand the difference.
Thanks for the information.
My last question regarding this issue is that why following code has an error for chartsheets...
I mean if ThisWorkbook includes above code and if you add new chartsheet to workbook, above code makes error...Please Login or Register to view this content.
Last edited by HerryMarkowitz; 08-11-2014 at 06:17 PM.
Again, it is probably misunderstanding of the difference between the "activewindow" object (that probably does not refer to any chart even if the chart is currently active object) (http://msdn.microsoft.com/en-us/libr...ice.15%29.aspx )and the "activechart" object (http://msdn.microsoft.com/en-us/libr...ice.15%29.aspx ). Depending on how this code snippet fits into the broader project, you may also need to understand the "selection" object, the "activeworkbook" object, the "activesheet" object, and so on.
As these kind of questions seem to center around how well we understand Excel's object model, you might spend some time with this: http://msdn.microsoft.com/en-us/libr...ice.15%29.aspx and trying to understand what is meant by each object and how to reference specific elements within Excel.
Thank you very much.
Last edited by HerryMarkowitz; 08-12-2014 at 03:19 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks