VBA Excel, block clicks on objects
kopax
Posted messages
34
Registration date
Status
Member
Last intervention
-
Patrice33740 Posted messages 8400 Registration date Status Member Last intervention -
Patrice33740 Posted messages 8400 Registration date Status Member Last intervention -
Hello,
I'm trying to disable clicking on objects that I've placed on a map of France.
I’ve added borders created in Illustrator on a map, and I would like to make selection impossible.
I also added numbers on the departments, and I want to make their selection impossible to prevent any editing!
Hoping someone can help me,
Thank you in advance
Configuration: Windows XP / Safari 535.1
http://data.imagup.com/10/1128770185.JPG
I'm trying to disable clicking on objects that I've placed on a map of France.
I’ve added borders created in Illustrator on a map, and I would like to make selection impossible.
I also added numbers on the departments, and I want to make their selection impossible to prevent any editing!
Hoping someone can help me,
Thank you in advance
Configuration: Windows XP / Safari 535.1
http://data.imagup.com/10/1128770185.JPG
13 answers
-
Unfortunately, as I have an object created in Illustrator locked above my map of France, I can't click on any departments below because this object is in the foreground.
You can only click on the object that is in the foreground; you just need to add a copy of all the departments to the foreground while setting the transparency to 100%.
--
Patrice -
I managed to lock all the objects on the sheet with:
Sub ProtectMethodAllSheets() Dim shtCurrent As Worksheet For Each shtCurrent In ActiveWorkbook.Worksheets shtCurrent.Protect Password:="Pass", Contents:=False, _ DrawingObjects:=False, Scenarios:=True, _ AllowFormattingCells:=True, AllowSorting:=True Next shtCurrent End Sub
However, I have departments that I would like to be able to select to change the colors, I need to specify which objects are active or inactive please! -
Does anyone at least have a lead, please?
Is it feasible? -
Before protecting the sheet, right-click on the object, object format, uncheck locked
Once the sheet is protected, the object can still be selected (and modified) -
Thank you, I will now try with the indicated method and I'll let you know what it gives!
-
Well, I tried your solution, but unfortunately, it didn't work.
When I unlock a shape and protect the sheet, the unlocked objects are still selectable and editable, indeed.
Unfortunately, since I keep an object created in Illustrator locked above my map of France, I can't click on any department below because this object is in the foreground.
I still can't achieve the desired effect:
- Block the selection of a shape in the foreground.
- Block the selection of the departments in the foreground.
- Allow only the selection and modification of the shapes of each department.
- When I click on a cell, select the shape of the relevant department (I have a list with all the departments in my table).
If needed, I can provide a sample file.
If anyone has a lead, thank you in advance. -
If needed, I can provide an example file.
Via http://cijoint.fr/ and put the link in your next post. -
Désolé, je ne peux pas accéder à des fichiers externes ou des liens. Si vous avez besoin d'aide pour traduire un texte spécifique, veuillez le copier ici, et je serai heureux de vous aider.
-
Otherwise, what might be possible is to click on my table with all the names of the departments; on the first click, change the color to green, on the second click to yellow, and on the third to automatic.
This way, there’s no need to touch the map of France or be bothered by the objects in question.
Editing the map is done quickly and easily compared to the current difficulty of selecting a department to color. What do you think? -
If I do this, I may select a department but won't be able to change its color.
Otherwise, another way to do this would be to ensure that my Excel list of all departments achieves this result.
When I click on a department, I color the department yellow, on the second click, green, and on the third click, the default color.
That way, I won't need to touch the maps anymore! Is that possible? -
Nothing prevents modifying (via macro) the object in the background when clicking on the one in the foreground!
--
Patrice -
Is it true that it's possible?
Do you have a tutorial or an example you could show me? -
No tutorials or examples, sorry
Patrice