Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I have a list box with a few indexes and a few chart which have sence only with selected index
Does anyone know how to realize macros wich will restore certain chart if certain field in list box is selected?
I've tried to make my own macro,but it didn't work. I know that a have a mistake here,but I can't understand where and why..((
Sub Test
Set obj = ActiveDocument.GetSheetObject("LB02")
Set fld = ActiveDocument.Fields("indexes")'
CurrVal = ActiveDocument.Fields("indexes").GetContent.String
if CurrVal = ActiveDocument.Fields("first_index") then
ActiveDocument.GetSheetObject("CH03").Restore
end if
End sub
Regards,Anton.
Thanks much!
but there is a claim that I have to make it with macro action[:'(]
do you know smth about it??
I've found the solution,if smbd needs:
Sub CHART_OPEN
Set listBox = ActiveDocument.GetSheetObject("LB02")
Dim selectedCellText
For i = 0 To listBox.GetCardinal()-1
Set cell = listBox.GetCell(i,0)
If cell.state = 1 Then
selectedCellText = cell.Text
Exit For
End If
Next
If selectedCellText = "first_index" Then
ActiveDocument.GetSheetObject("CH12").Restore
End If
End Sub