Code Librarian / Set Custom Value

J

Jim

Hi all,

I am very confused. I am trying to set the value of a custom property in my
shape. The code librarian has some nice code examples but it is incomplete
and is more confusing. The sample code in 'Custom Property Set' in section
'Microsoft Visual Basic 6.0' has the line 'SetCellValueToString vsoCell,
CStr(varValue)'. Well, this is not a valid command and there is no
information on the SetCellValueToString function.

Any help would be greatly appreciated.

Jim
 
J

Jim

This is the most recent code I have tried and it does not work.

Public Sub NameDevice()
Dim vsoShape As Visio.Shape
Dim ShapeName As String
Dim cName As Integer
Dim strpropname As String
Dim vsoCell As Visio.Cell
cName = 10001
On Error GoTo ErrReport
For Each vsoShape In OBcollection
strpropname = "prop.function"
Set vsoCell = vsoShape.CellsU(strpropname)
If UCase(Left(vsoCell.ResultStr(visNoCast), 2)) = "AC" Then 'Accum
ShapeName = "GC" & cName
Set vsoCell = vsoShape.Cells("prop.devicename")
vsoCell.Formula = ShapeName
'<--------------------------------This does not work.
ElseIf UCase(Left(vsoCell.ResultStr(visNoCast), 2)) = "RA" Then 'RAT
Set vsoCell = vsoShape.Cells("prop.function")
vsoCell.Formula = "GT" & cName
End If
cName = cName + 1
Next
End
ErrReport:
MsgBox "Process Failed " & Err.Description
End Sub
 
A

Al Edlund

this is also in the code librarian,
Al


Public Sub SetCellValueToString(ByVal formulaCell As
Microsoft.Office.Interop.Visio.Cell, _
ByVal newValue As String)

Try

' Set the value for the cell.
formulaCell.FormulaU = StringToFormulaForString(newValue)

Catch err As Exception
System.Diagnostics.Debug.WriteLine(err.Message)
End Try

End Sub
 
J

Jim

Thanks Al,

The references in the code librarian are not clear. I'll do a better search
next time.

Jim
 

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