Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing shape data

Status
Not open for further replies.

PhilBreau

Technical User
Dec 14, 2001
108
CA
Good day all,

Using Visio 2007 standard edition.

I have linked shape data to an excel spreadsheet. If I change the data in the spreadsheet and open the diagram, I have to manually refresh each shape. I copied a macro that runs on DocumentOpened, but get a popup that says I can only run in professional edition.

I tried the following code (found it at
Private Sub Document_DocumentOpened(ByVal doc As IVDocument)

Dim vsoDataRecordset As Visio.DataRecordset
Dim intCount As Integer
Dim szMessageText As String
Dim szBoxTitle As String


intCount = ThisDocument.DataRecordsets.Count
szBoxTitle = "Data Refresh Result"
If intCount > 0 Then
Set vsoDataRecordset = ThisDocument.DataRecordsets(intCount)
vsoDataRecordset.Refresh
szMessageText = "All Data Records have been successfully refreshed."
Else
szMessageText = "I've no Data Attached."
End If

MsgBox szMessageText, vbOKOnly + vbInformation, szBoxTitle

End Sub


When I open the drawing, I get the following message "This operation requires Microsoft Visio Professional."

Is there a way I can refresh all shapes in Visio 2007 standard edition?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top