2

for a project I am creating a UserForm that reads values from textboxes and generates Shapes with the data. So after dropping a shape I want to change the Shape Data rows, for example "Prop.SO_Name".

When I use

shp.CellsU("Prop.SO_Name").FormulaU = """Test"""

It works just fine. But I want to read a value from the textbox. I tried

Dim cell As Visio.cell
Set cell = shp.Cells("Prop.SO_Name")
cell.FormulaU = TextBox2.Value

But it returns a runtime error. I also tried

Dim str as String
str = Textbox2.value
Dim cell As Visio.cell
Set cell = shp.Cells("Prop.SO_Name")    
cell.FormulaU = str

With the same result.

I looked into the documentation for the FormulaU Property but they do it, apparently, just like I tried. Clearly I am missing something.

1 Answer 1

2

`Try use

Dim cell As Visio.cell  
Set cell = shp.Cells("Prop.SO_Name")  
cell.FormulaU = chr(34) & UserForm1.TextBox2.Value & chr(34)

Update You try write string to ShapeSheet cell ! The double quotes within the string is one way to tell VB[A] to make a string with embedded quote mark characters in it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.