C++ Excel Automation

P

PaulH

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?
 
J

John Bundy

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.
 
P

PaulH

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
 

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