Seleting objects instead of cells ??

keldsor

Board Regular
Joined
Jun 9, 2017
Messages
52
I have a workbook with a worksheet with a lot of shapes like DOT.

Each dot represents an event and I can get the details for a specific event shown in Word by double clicking on the DOT for the event I want to see the details for.

I HAVE to do "double clicking" for the details to show up in Word AND bring Word in front on the screen, BUT ...

unfortunately this "double clicking" takes Excel out of "Selecting objects"-mode and inte "Selecting cells"-mode !

When I opens the workbook I have this code to secure it opens in "Select objects"-mode:

Code:
Private Sub Workbook_Open()
    If ActiveSheet.Shapes.Count > 0 Then Application.CommandBars.ExecuteMso "ObjectsSelect"
End Sub

How can I sort of "lock the workbook in that "Select-Objects-mode" ?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I guess you have a macro assigned to each object in order to open Word - Right? If so then you should just click the objects (shapes) ... no need to double-click them.
 
Last edited:
Upvote 0
I guess you have a macro assigned to each object in order to open Word - Right? If so then you should just click the objects (shapes) ... no need to double-click them.

As I write, I HAVE to double click to get Word in front.

If I just click then a Word icon is blinking in the process line and I have to click on that icon to get Word in front.

What about this locking I was asking for ?
 
Last edited:
Upvote 0
I guess you have a macro assigned to each object in order to open Word - Right? If so then you should just click the objects (shapes) ... no need to double-click them.

Yeah, I just tried again very carefully ... and you're right just a single click is enough ... BUT

IF the user is a little excited and make a double click then it brings Excel out of this "Select object"-mode and it works no more !

That's why I asked for that "locking" mothod OR some code to FORCE the mode on again - I tried this:

Application.CommandBars.ExecuteMso "ObjectsSelect"

in the .OnAction method chain but it doesn't turn the mode on again.
 
Upvote 0
I tried this too in the .OnAction method chain - I found out it's a toggle switch, so I have to check the state first:

Code:
    With Application.CommandBars
        If .GetPressedMso("ObjectsSelect") = False Then .ExecuteMso "ObjectsSelect"
    End With

Doesn't do it either !
 
Upvote 0
I am not entirely sure I understand but try this ans see if it works for you :

Code in the ThisWorkbook Module:
Code:
Option Explicit

Private WithEvents cmbrs As CommandBars

Private Sub Workbook_Open()
    With Application
        If ActiveSheet.Shapes.Count > 0 Then .CommandBars.ExecuteMso "ObjectsSelect": Set cmbrs = .CommandBars
    End With
    Call cmbrs_OnUpdate
End Sub

Private Sub cmbrs_OnUpdate()
    With Application.CommandBars
        If .GetPressedMso("ObjectsSelect") = False Then .ExecuteMso "ObjectsSelect"
    End With
End Sub
 
Last edited:
Upvote 0
I am not entirely sure I understand but try this ans see if it works for you :

Code in the ThisWorkbook Module:
Code:
Option Explicit

Private WithEvents cmbrs As CommandBars

Private Sub Workbook_Open()
    With Application
        If ActiveSheet.Shapes.Count > 0 Then .CommandBars.ExecuteMso "ObjectsSelect": Set cmbrs = .CommandBars
    End With
    Call cmbrs_OnUpdate
End Sub

Private Sub cmbrs_OnUpdate()
    With Application.CommandBars
        If .GetPressedMso("ObjectsSelect") = False Then .ExecuteMso "ObjectsSelect"
    End With
End Sub

It works in the sence that the "Select object"-mode is NOT turned off if the user fools around making click or double click on the dots, BUT ...

now the bringing Word in front does NOT work by just (one) click on the dot = the Word icon in the process line is blinking and I have to click on this icon to bring Word in front.
 
Upvote 0
I am confused because in your first post you said that you need to double-click the word icond and now you want it to work by just one click !

Can you explain more clearly what you would like to happen ?

And what exactly do you mean by "dot" ?
 
Last edited:
Upvote 0
I am confused because in your first post you said that you need to double-click the word icond and now you want it to work by just one click !

Can you explain more clearly what you would like to happen ?

And what exactly do you mean by "dot" ?

A DOT is MY representing of an event on a timeline - just a circle small enough to show as a DOT .. 2-3 millimeters in diameter.

In my first posting I was NOT aware of that you just have to single click on a DOT ... and then Word opens and comes into front - I was fooling around not clear on single and/or double clicking - but as I write in posting #4 it works as you said.

I want it to open Word showing the details for the event I'm clicking on - I don't care if I should use single or double click.

What fooled me into talking about this double clicking was because the "Select object"-mode was turned OFF and then NOTHING works at all.

Now it SEEMS like I HAVE to double click to get Word in front with the details ... argh !

In fact it was BETTER before = a single click ... BUT the "Select object"-mode must NOT be turned off IF you accidently makes a double click.
 
Upvote 0
I now played some time with the last solution ... and it works nicely !

I think I'm fooled by some open (=active) VBA code windows when it's NOT working ;-))

I now started a testrun from Desktop and ALL other closed .... and it work as I want it to !

Thx for your time !
 
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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