VSTO Excel with Autoshapes, Connectors and Polylines on Worksheet?

T

theophan

I have read some of the thread on VSTO but none seem to address my specific
concerns on using shape objects and one of the VSTO MVP's sent me to the
"Excel specialists" here. Please see below and offer what you can.
-----------------------------------------
I am a typical VBA "hack" that has seen my Excel VBA Forms Configuation Tool
evolve into a graphical representation of the collected data NOT using CHARTS
but Objects (with events) place on the Worksheet.

My question is what is the "preferred" method (or alternatives) for placing
drawing Objects (AutoShapes) when moving to VSTO. From my reading it seems
that WinForms does not support this (neither do Excel 2003 User Forms) but
neither can I find a good reference for Office 2003 Shapes on a Worksheet (It
seems 2007 has something called SmartArt...). Surely VSTO supports this
somehow in Word and Visio so what about Excel?

Perhaps a code sniplet using Visual Basic 2005?

I would appreciate an education - invitation to "take me to school"
 
J

Jon Peltier

So you are making charts using rectangles and other shapes? This is not too
complicated if you can keep track of all the shapes and their positions.

The usual suggestion is to turn on the macro recorder, create and edit some
shapes, then examine the recorded code. In Excel 2007 this is not a viable
approach because they didn't have time during Office 2007 development to tie
the smart art stuff to the macro recorder. Whatever, you can record the
macro in 2003, and use it without much hassle in 2007. Your best references
for this process are Office 2003 VBA, including the macro recorder and the
VBA Editor's Object Browser, and Google.

- Jon
 
T

theophan

Thanks Jon - I actually have progressed well beyond the macro editor and have
written a class that keeps track of the Shapes data, my question has to do
with VSTO's support of these kinds of Shapes on a WORKSHEET (Not a WinForm).

VSTO does not appear to support the macro Editor and I could not find any
reference to the types of Objects in the subject.

maybe my wife is right - I am BLIND?
 
J

Jon Peltier

I haven't gotten into VSTO. I've had practically no pull from clients.

Can't you hook into the Excel object library? Once you have a link, you
should be able to use whatever object browser VSTO has to find the precise
syntax for what the recorded macros in VBA can do. There's no reason I know
of that VSTO couldn't handle the shapes on a sheet. You just need to use the
appropriate references.

- Jon
 

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