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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a new Open Visio, & create a new document from VBA

Status
Not open for further replies.

garybug

Programmer
Jul 27, 2003
42
GB
Hello all,

I am trying to open Visio and paste a chart into it from Powerpoint, and from there saving it as a .wmf, or.emf file, all via VBA, not sure of the code though..
I tried creating a new Visio Application via-

Private VS As Visio.Application

-but it wasnt having any of it!

Any advice please?
Thanks

GARYBUG (bzz)
 
Here's a snippet I used in a VB app - haven't tested it in VBA

Dim visApp As Visio.Application
Dim visDoc As Visio.Document
Set visApp = New Visio.Application
Set visDoc = visApp.Documents.Add("c:\test\bases.vsd")
' do your thing here eg:
MsgBox visDoc.DocumentSheet.Name
' Then tidy up
visApp.Quit
Set visDoc = Nothing
Set visApp = Nothing

Good luck!

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top