Detecting "real" formula in a cell

  • Thread starter Mike Greenawalt
  • Start date
M

Mike Greenawalt

I want to be able to distinguish between a cell that contains a "real"
formula, eg. =MAX(TEXTWIDTH(TheText),5*Char.Size) versus a number
(=1.234) or a string.

I tried using the FORMULAEXISTS() function, but Visio considers all
these cases to be formulas.

I cannot find any functions that can make that distinction.

Any thoughts?

-- Mike
 
M

Mark Nelson [MS]

Programmatically you can compare the FormulaU and ResultIU properties of the
cell, but I don't think this is possible within the Shapesheet.
 
M

Mark Nelson [MS]

You might explain what you are ultimately trying to do, because there might
be a different way to do it.
 
M

Mike Greenawalt

I was hoping to avoid doing programming beyond shapesheet formulas.

What I am trying to accomplish is to have a 1-D connector shape detect
when it is connected at both ends. We use Visio to develop diagrams
which get post-processed outside Visio (from .vdx file), and it is
important that all connectors on the pages actually *be* connected on
both ends. Just relying on the visual appearance of the diagram is not
enough, as you see the connector visual clues only when the connector
shape is selected.

I would like to have the shape itself detect when it is not connected on
both ends and give some kind of signal, maybe changing color (blinking
would be nice, but probably a lot more difficult) that would be visible
even when the shape is not selected.

So far, the only signal I have seen that indicates a connected state in
the shapesheet is that the BeginX/Y, EndX/Y cells get filled with a
formula that calculates position from parameters of the connectee
shape(s). I have been looking for a way to detect that.

Our users start with a stencil of shapes that we have created for our
domain and a blank drawing page. I had hoped to be able to do what I
want within the confines of the Shapesheet and avoid VBA programming, as
that makes delivery more complicated.

I would think someone out there would have wanted to do something
similar. I hope they can respond.

-- Mike
 
M

Mark Nelson [MS]

That is a good scenario, but I don't know of a way to accomplish that using
just the Shapesheet.

There are programming alternatives that avoid VBA. One option is a COM
Add-in. This can be created in VB but is deployed as a DLL.
 
M

Mike Greenawalt

Markus -

This is a super solution! Thank you, thank you.

I had managed to accomplish what I wanted, but I had to write a VBA
function to do it.

You have accomplished the same thing using only Shapesheet formulas.

I will use your method - though I need to let my users choose their own
text and final color.

-- Mike
 
M

Markus Breugst

This is a super solution! Thank you, thank you.

Well, thank YOU for your question. I also implemented this check with
automation, and I did not even get the idea to try it via the ShapeSheet.
Guess I can simplify our solution now.

Best regards,
Markus
 

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