LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default how to open visio file by Excel VBA

On 8¤ë1¤é, ¤U¤È9®É48¤À, "Chip Pearson" wrote:
The following code works for me with Excel 2007 and Visio 2007.

Sub OpenVisioDoc()
Dim FName As String
Dim VisioApp As Object

On Error Resume Next
Set VisioApp = GetObject(, "Visio.Application")
If VisioApp Is Nothing Then
Set VisioApp = CreateObject("Visio.Application")
If VisioApp Is Nothing Then
MsgBox "Can't connect to Visio"
Exit Sub
End If
End If
On Error GoTo 0
FName = "C:\Path\FileName.vsd"

VisioApp.documents.Open FName '
VisioApp.Visible = True
End Sub

"moonhk" wrote in message

...



Hi All


how to open visio file by Excel VBA ?


I try below coding not ok.


Set oApp = CreateObject("Visio.Application")
oApp.Visible = True
MsgBox FN
oApp.Documents.Open FN- ÁôÂóQ¤Þ¥Î¤å¦r -


- Åã¥Ü³Q¤Þ¥Î¤å¦r -


Using below coding works.

'~~ http://support.microsoft.com/kb/309603
Set oApp = CreateObject("Visio.Application")
Set docsObj = oApp.Documents
Set DocObj = docsObj.Open(FN)
' Clear the variable from memory.
Set docsObj = Nothing
Set DocObj = Nothing
Set oApp = Nothing
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I export a Excel file to a Visio drawing? AES/BRS Excel Discussion (Misc queries) 0 April 25th 10 06:04 PM
Microsoft Visio templates - Stencil for Visio to create IT diagrams &network design Betty Carson Excel Worksheet Functions 2 December 10th 09 06:41 AM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
workbooks.open function fails to open an existing excel file when used in ASP, but works in VB. san Excel Programming 1 January 3rd 06 03:22 AM
Can an Excel file be converted into Visio? jim314 Excel Discussion (Misc queries) 0 April 18th 05 06:34 PM


All times are GMT +1. The time now is 03:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"