Retrieving Dropdown/Option Button Values

E

entonne

Thank you Tom for your help, if I could borrow your brain for one mor
thing.

I've been able to retrieve the values from multiple files usin
something like this:


Code
-------------------

Dim wb As Workbook
Application.ScreenUpdating = False
Set wb = Workbooks.Open("filename.xls", True, True)

Get the values, close the file, free up memory etc.


-------------------


Is there away to do the same thing using this ExecuteExcel4Macr
funtion? I grabbed the following off the net and it retrieves th
value of a specific cell without opening the file. Is it possible tha
instead of asking for a specific cell, ask for the value of the dro
down object? And if so, which way is best?


Code
-------------------

Dim arg As String
arg = "'" & path & "[" & file & "]" & sheet & "'!" & Range(ref).Range("A1").Address(, , xlR1C1)

GetValue = ExecuteExcel4Macro(arg)
 
T

Tom Ogilvy

I would think not. You can't do

=C:\Myfolder[Mybook.xls]Sheet1!OptionButton6.Value

as a formula in a cell. However, the xl4 macro language is richer that just
worksheet formulas, so I wouldn't be quick to say there is no way, but I am
not aware of any (but then it isn't something I have pursued, either).

--
Regards,
Tom Ogilvy



entonne said:
Thank you Tom for your help, if I could borrow your brain for one more
thing.

I've been able to retrieve the values from multiple files using
something like this:


Code:
--------------------

Dim wb As Workbook
Application.ScreenUpdating = False
Set wb = Workbooks.Open("filename.xls", True, True)

Get the values, close the file, free up memory etc.


--------------------


Is there away to do the same thing using this ExecuteExcel4Macro
funtion? I grabbed the following off the net and it retrieves the
value of a specific cell without opening the file. Is it possible that
instead of asking for a specific cell, ask for the value of the drop
down object? And if so, which way is best?


Code:
Range(ref).Range("A1").Address(, , xlR1C1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top