View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
PaulH PaulH is offline
external usenet poster
 
Posts: 8
Default C++ Excel Automation

I have an Excel macro that displays a user form in the way I want but calling
it from an external application is proving problematic. I am not sure this
method will work with all versions of Excel and getting the selected range
back into the external application is proving problematic.

Any further help or ideas are appreciated.

Thanks

"John Bundy" wrote:

It all depends how you open excel, full version, in a control etc. but you
can use a userform with a refedit control to let them select a range and
return the value as yo requested.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"PaulH" wrote:

I need to reference a range of cells within Excel from an external
application. I need a simple string in the form Sheet!A4:B8 for example, but
I need this to be interactively selectable using Excel.

I have seen this done before in another application but I am not 100% sure
how. Ideally I would like a simple dialog with a line edit control for the
range and OK/Cancel buttons. This dialog would be shown along with Excel.
The user could then select a range within a worksheet and the result would be
displayed in the line edit control in the dialog. When the user is happy
they can click OK and the range would be available in the external
application. Ideally Excel would have very limited functionality to only
allow a range to be clicked and dragged.

I can run excel using automation in C++ and set a range etc but the problem
is getting notification back that a range has changed in Excel. Anyone got
any ideas?