'how to launch a Data Wizard (create diagram from a template) in Visio from Access
I'm trying to make a button in Access, that will open Visio and launch a Data Wizard to create a diagram. I've tried various solutions, but all I get is opening a blank Visio document (based on my template). The Wizard is not kicking in. For comparison, simply clicking on a template.vstx launches the wizard. I cannot reproduce this behavior from within VBA.
Many thanks for any tips
here is the code I'm working with:
Function openvis()
Dim vis As Visio.Application
Set vis = CreateObject("Visio.Application")
With vis
.Visible = True
.Documents.Add "C:\Templatev2.vstx"
End With
End Function
Solution 1:[1]
Finally i've found a solution that launches Visio data wizard on custom template from Access:
'CreateObject("Shell.Application").Open "C:\path\mytemplate.vstx"
Solution 2:[2]
I created a VBA macro as follows:
Sub test()
Dim vis As Visio.Application
Set vis = CreateObject("Visio.Application")
With vis
.Visible = True
.Documents.Add "C:\Users\paul\Documents\Drawing1.vstx"
End With
End Sub
and it all works fine. Wizard starts.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Pawel127 |
| Solution 2 | Paul Herber |
