Getting X and Y in VBA

C

Chuck

How do I get the (x,y) of a shape in VBA?

I can get the coordinates when exporting to a table as the fields PinX and
PinY - but what are the VBA properties on the shape object?
 
C

Chuck

Very useful!

I have trouble opening a visio file - when I run the following code from
excel VBA:
' Open the file
PathFileName = PathName & CurrFileName
Set docObj = Documents.Open(PathFileName)

I have made a reference to the visio objects and I have defined docObj as a
Visio.document, but it doesn't work?

The code works when used within Visio - but I want to run it from Excel....

Any suggestions?
 
C

Chuck

John - just tried it. Doesn't work.

In the meantime I've decided to use VBA in Access - and here it doesn't work
either...

Chuck
 
M

Mark Nelson [MS]

If you are running code to open a Visio document in VBA in another app, you
likely need to supply a Visio Application object. This object is taken for
granted in Visio VBA, but in another app this must be supplied. Usually you
get an application object with a CreateObject or GetObject method.

Once you have a Visio Application object, you can use it to open a document:

Set docObj = visApplication.Documents.Open(PathFileName)
 

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