US Units to Metric in VBE

J

John

Hi there,

Can anyone tell me how the Metric/US Units are set in the VBE? Does it
refer to each document or is it a global setting?

I have, what as far as I can tell is, a metric drawing (page setup uses
millimetres), but when I write code in the VBE I end up having to use inches
rather than millimetres. This is kind of confusing particularly when I try
and drop a shape relative to another. It took some time to work out that
the shape was dropped not 10mm to the right of the shape but 10 inches (and
off the page!).

Thanks

John
 
J

junethesecond

In VBA all dimensions seem to be recognized as "inch", except some
properties for cell object like result property.
One of the simple way to input values as mm in the program may be to
devide the values by 25.4.
 
J

John

Thanks June. I'll use the conversion in future although you would have
thought that a global setting in the VBE wouldn't be that tricky!

Thanks for your help

John
 
M

Mark Nelson [MS]

VBA really has nothing to do with measurements. Visio Shapesheet cells deal
with measurements, and these values can be accessed programmatically. There
are a number of methods on a Cell object to get and set values. The Result
method takes the unit type as a parameter, so you can ask for a value in any
unit system you like. ResultIU always uses Visio's internal units which is
inches for length measurements.
 
J

John

Thanks for the clarification Mark. I hadn't realised about parameter part
of Result.

Best regards

John
 

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