S
Sankalp
Hello,
Am trying to enter data in a shapesheet (user-defined cells) through some
VBA.
I am able to enter the value for the cell - visUserValue, but am NOT able
assign some text to the cell ->visUserPrompt.
*************************
Private Sub Document_DocumentSaved(ByVal doc As IVDocument)
Dim vsoApp As Visio.Application
Dim vsoWnd As Visio.Window
Dim vsoSelection As Visio.Selection
Dim vsoShape As Visio.Shape
Dim vsoSection As Visio.Section
Dim vsoCell As Visio.Cell
Set vsoApp = doc.Application
Set vsoWnd = vsoApp.ActiveWindow
Set vsoSelection = vsoWnd.Selection
Dim nItems As Integer
nItems = vsoSelection.Count
Dim nCnt As Integer
Dim nRow As Integer
If (nItems > 0) Then
Set vsoShape = vsoSelection.Item(1)
If (vsoShape.SectionExists(visSectionUser, True)) Then
Set vsoSection = vsoShape.Section(visSectionUser)
Else
vsoShape.AddSection (visSectionUser)
Set vsoSection = vsoShape.Section(visSectionUser)
End If
nCnt = vsoSection.Count
nRow = vsoShape.AddRow(visSectionUser, visRowUser + nCnt,
visTagDefault)
Set vsoCell = vsoShape.CellsSRC(visSectionUser, (visRowUser + nRow),
visUserPrompt)
vsoCell.Formula = "PD" 'FAILS
'vsoCell.FormulaForce = "PD" 'FAILS
'vsoCell.FormulaForceU = "PD" 'FAILS
Set vsoCell = vsoShape.CellsSRC(visSectionUser, (visRowUser + nRow),
visUserValue)
vsoCell.Formula = "100001"
End If
End Sub
*************************
What I am trying to do is set name-value pairs in these columns and later
read them when needed.
Am I doing anything wrong? Is this the suggested approach to save some user
specific data?
Thanks,
Sankalp
Am trying to enter data in a shapesheet (user-defined cells) through some
VBA.
I am able to enter the value for the cell - visUserValue, but am NOT able
assign some text to the cell ->visUserPrompt.
*************************
Private Sub Document_DocumentSaved(ByVal doc As IVDocument)
Dim vsoApp As Visio.Application
Dim vsoWnd As Visio.Window
Dim vsoSelection As Visio.Selection
Dim vsoShape As Visio.Shape
Dim vsoSection As Visio.Section
Dim vsoCell As Visio.Cell
Set vsoApp = doc.Application
Set vsoWnd = vsoApp.ActiveWindow
Set vsoSelection = vsoWnd.Selection
Dim nItems As Integer
nItems = vsoSelection.Count
Dim nCnt As Integer
Dim nRow As Integer
If (nItems > 0) Then
Set vsoShape = vsoSelection.Item(1)
If (vsoShape.SectionExists(visSectionUser, True)) Then
Set vsoSection = vsoShape.Section(visSectionUser)
Else
vsoShape.AddSection (visSectionUser)
Set vsoSection = vsoShape.Section(visSectionUser)
End If
nCnt = vsoSection.Count
nRow = vsoShape.AddRow(visSectionUser, visRowUser + nCnt,
visTagDefault)
Set vsoCell = vsoShape.CellsSRC(visSectionUser, (visRowUser + nRow),
visUserPrompt)
vsoCell.Formula = "PD" 'FAILS
'vsoCell.FormulaForce = "PD" 'FAILS
'vsoCell.FormulaForceU = "PD" 'FAILS
Set vsoCell = vsoShape.CellsSRC(visSectionUser, (visRowUser + nRow),
visUserValue)
vsoCell.Formula = "100001"
End If
End Sub
*************************
What I am trying to do is set name-value pairs in these columns and later
read them when needed.
Am I doing anything wrong? Is this the suggested approach to save some user
specific data?
Thanks,
Sankalp