Set User.cell Values with VBA

Started by Jumpy, March 26, 2010, 08:19:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jumpy

Hello Forum,
I use the following code to set the formulas of some user defined cells. Problems see below:

Sub Autofill()
Dim shp As Visio.Shape
Dim Test As String

For Each shp In ActivePage.Shapes

If shp.CellExists("User.Automatismus", True) Then
shp.Cells("User.Automatismus").FormulaU = 0
End If

Test = Chr(34) & "=IF(FlipX+FlipY=1,Angle,-Angle)" & Chr(34)
'Test = "IF(FlipX+FlipY=1,Angle,-Angle)"
If shp.CellExists("User.Winkel", True) Then
shp.Cells("User.Winkel").Formula = Test
End If

Test = Chr(34) & "Pufferspeicher" & Chr(34)
If shp.CellExists("User.Gruppe", True) Then
If shp.Cells("User.Gruppe").Result("") = 0 Then
 shp.Cells("User.Gruppe").Formula = Test
End If
End If

Next

End Sub


The cell User.Automatismus gets the value 0. But what I really wanted to do, is set it to FALSE but I don't know how.
I tried "FALSE", FALSE, CHR(34)... but I only get "FALSE" or an error.
(I know that for Visio False is the same as 0, but I later want to read this cell with ResultStr() and than False is not the same as 0)

In User.Winkel I want to set a formula, but I get either an error or the formula inside "". That problem only exist in cells like user.cells because those cells accept formulas and strings.
The same formula send to, for example the Height cell, would be accepted as a formula there (without the "").

By the way: The formula is another option for text to be displayed readable, instead of using the BitExOr variant.

Aeon