View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] intet.nyt@gmail.com is offline
external usenet poster
 
Posts: 3
Default How do I find the currently selected Scenario?

On Feb 2, 5:51*am, "Héctor Miguel"
wrote:
hi, (?)

Maybe this is a simple thing, but I don't seem to be able to track it down.
I have an Excel sheet with a couple of Scenarios defined.
I am trying to implement some VBA functions where I need to know which Scenario is currently selected.
Does anyone know how I determine the active Scenario from VBA?
Any help will be greatly appreciated. Thanks in advance.


this code line returns a null string ("") if no scenario is active/selected/... or, the name of current scenario:

application.commandbars.findcontrol(id:=1737).text

hth,
hector.


Hello again,

Now another problem has arisen. When I call the code you mention, I
get a new error:

-------------------
Run-time error '-2147467259 (80004005)':

Method 'Text' of object '_CommandBarComboBox' failed.
-------------------

What can be?

Thanks in advance.

Best regards,
Lasse