J
JeroenM
I need an overview of all .vsd files in a certain directory, and for each
..vsd file the name of the seperate pages. I want to create this overview in
Excel using the following VBA code:
Dim vsoDoc As Visio.Document
Dim vsoPag As Visio.Page
Dim vsoPags As Visio.Pages
With Application.FileSearch
.NewSearch
.LookIn = FolderPath
.SearchSubFolders = True
.FileName = "*.vsd"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
End With
With Application.FileSearch
For i = 1 To .FoundFiles.Count
Set vsoDoc = Visio.Application.Documents.Open(FileName)
Set vsoPags = vsoDoc.Pages
For Each vsoPage In vsoPages
…………
Next
Next i
End With
Set vsoDoc = Nothing
Set VsoPags = Nothing
Set vsoPag = Nothing
When I run the VBA code in Excel it gives me the following message: Error
429 / ActiveX can't create object. This error appears on the following line:
"Set vsoDoc = Visio.Application.Documents.Open(FileName)".
I already made a reference to the following library: Microsoft Visio 11.0
Type Library, but that didn't help.
Who can help me?
Thanks, JeroenM.
..vsd file the name of the seperate pages. I want to create this overview in
Excel using the following VBA code:
Dim vsoDoc As Visio.Document
Dim vsoPag As Visio.Page
Dim vsoPags As Visio.Pages
With Application.FileSearch
.NewSearch
.LookIn = FolderPath
.SearchSubFolders = True
.FileName = "*.vsd"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
End With
With Application.FileSearch
For i = 1 To .FoundFiles.Count
Set vsoDoc = Visio.Application.Documents.Open(FileName)
Set vsoPags = vsoDoc.Pages
For Each vsoPage In vsoPages
…………
Next
Next i
End With
Set vsoDoc = Nothing
Set VsoPags = Nothing
Set vsoPag = Nothing
When I run the VBA code in Excel it gives me the following message: Error
429 / ActiveX can't create object. This error appears on the following line:
"Set vsoDoc = Visio.Application.Documents.Open(FileName)".
I already made a reference to the following library: Microsoft Visio 11.0
Type Library, but that didn't help.
Who can help me?
Thanks, JeroenM.