Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi again community!!!
I have an easy cuestion for you. I am trying to create a a macro which funcionality must be clear all selections when I active one special sheet. The code I wrote was:
sub CLEAR_SLECTIONS
Activatedocument.clearselection
end sub
In other examples I saw, this functionality was asigned by a shorcut, but this time I only see macro options (sheet properties). Could anyone help me?
Thanks in advanced!!!! Fiber9906
Hi:
Read Eric's suggestion. Avoid macros. They work fine locally but not always via plug-in and/or via Ajax.
QV has a collection of actions already made. One of those actions is Unlock & Clear all selections.
What version of QV are you using?
If your QV does not have actions, do as you're doing.
I'd use better:
ActiveDocument.UnlockAll
ActiveDocument.ClearAll true
Ok.
Right-Click on your button and click on properties
in the action tab add a new action under the Selection Action type and select the "clear all" action!
I´m so sorry Ali, but I don´t understand you. On sheet properties, I select Macro tab and I assign CLEAR_SELECTIONS macro. My real problem is that script on edit module button is wrong.
I don´t see what you are trying to explain me...
Nevertheless, thanks for your soon reply!!
Fiber9906
Try this:
Go to your sheet properties -> Triggers tab
On the box with the onActivateSheet (on the top), click on Add Actions (or Edit if you already have something there)
On the new window, click on Add
Action Type = External
Action = Run Macro
Click OK
Macro Name = CLEAR_SLECTIONS
On ali_hijazi suggestion , you don't need to write your macro, you only use the action already created
For this, you can:
Go to your sheet properties -> Triggers tab
On the box with the onActivateSheet (on the top), click on Add Actions (or Edit if you already have something there)
On the new window, click on Add
Action Type = Selection
Action = Clear All
Hope this helps,
Erich
Erich, I still don´t have (or see) the options you are telling me. I attach what I am seeing...
My current version is 8.5.
Thanks, Fiber9906
Hi:
Read Eric's suggestion. Avoid macros. They work fine locally but not always via plug-in and/or via Ajax.
QV has a collection of actions already made. One of those actions is Unlock & Clear all selections.
What version of QV are you using?
If your QV does not have actions, do as you're doing.
I'd use better:
ActiveDocument.UnlockAll
ActiveDocument.ClearAll true
Ok.
I was trying to tell you that you can accomplish this by putting a Button object which when you click clears all selections
Anyways Christian77 gave you the correct answer