Count shows 1 when nothing is selected ??

keldsor

Board Regular
Joined
Jun 9, 2017
Messages
52
Count shows 1 when nothing is selected ??

I can'r figure out why:

? ActiveWindow.Selection.Count
in the immidiate window shows 1 when no shape is selected !

When 1 shape is selected the immidiate window shows ERROR 438 - Object doesn't support this property or method !

When 2 or more shapes are selected the
? ActiveWindow.Selection.Count
shows the right counting of selected shapes !

What do I misunderstand here ?
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
? ActiveWindow.Selection.Count
in the immidiate window shows 1 when no shape is selected !
That code has nothing to do with shapes as such, it's just whatever is selected. so if you have 49 cells selected it will return 49.

Why it gives an error with one shape selected, but works with multiple shapes selected I'm not sure.
 
Upvote 0
That code has nothing to do with shapes as such, it's just whatever is selected. so if you have 49 cells selected it will return 49.
You're right about the count of selected cells - but I have turned ON the selection of OBJECTS and it HIDES the selection of the cells but they are still selected and ? ActiveWindow.Selection.Count STILL shows the correct count of selected CELLS with NO shapes selected - that's explainable and understandable - but when Shapes (2 or more !) are selected the "? ActiveWindow.Selection.Count" sort of takes over and counts selected Shapes instead (the cells are STILL selected but NOT visible though !)

But ofcause it has 'something' to do with Shapes too - that's why it 1) makes an error when 1 shape is selected, and 2) it returns the correct counts when 2 or more is selected !

So something has to be explained here !
 
Upvote 0
Selection has nothing to do with shapes as such, it's simply whatever is selected at that time, be it a shape, a cell, a control, a graph etc.
 
Upvote 0
Selection has nothing to do with shapes as such, it's simply whatever is selected at that time, be it a shape, a cell, a control, a graph etc.
It makes NO sense with my samples in mind, but ... I think I'll have to close it here ...
 
Upvote 0
There are no samples in your op.
 
Upvote 0
Oh, no ... you said it yourself ... you can't explain what's is going on !

So, lets stop here ... bye bye
 
Upvote 0
I can't explain why a single shape returns an error, but I have already explained why you get a count when no shapes are selected, which you don't seem to accept.
 
Upvote 0

Forum statistics

Threads
1,215,263
Messages
6,123,956
Members
449,135
Latest member
jcschafer209

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top