A
Alexander Overmann
Hi
I want to launch Vision 2003 and place a shape with VB(A) from MS-Access
2003
I do this:
1. Set reference to Visio 11 Type Library
2. Create a form with this code:
----------CODE
Dim VsoApp As Object
Dim VsoShape As Visio.Shape
Dim obj As Object
Dim VsoActivePage As Object
Set VsoApp = GetObject("", "Visio.Application")
VsoApp.Documents.AddEx "", visMSDefault, 0
VsoApp.Documents.OpenEx "periph_m.vss", visOpenRO + visOpenDocked
Set obj = VsoApp.Documents.Item("PERIPH_M.VSS").Masters.ItemU("Router")
Set VsoActivePage = VsoApp.Activepage
Set VsoShape = VsoActivePage.Drop(obj, 1, 1)
VsoShape.Characters = "Testchar"
VsoShape.NameU = "nameu Test"
VsoApp.Activepage.Layout
VsoApp.Quit
Set VsoApp = Nothing
-----CODE
I have already replace the "Dim ... as <visio datatype>" with OBJECT in
order to change from early binding to late binding.
Currently this code works fine! Now I replace the last line filled with
visio datatype:
Dim VsoShape As Visio.Shape with
Dim VsoShape As Object
and remove the reference to the visio type library.
But now the code wont run any more Visio still starts but I got at line
Set VsoShape = VsoActivePage.Drop(obj, 1, 1)
the runtime error 91 (and the german message: Objektvariable oder
With-Blockvariable nicht festgelegt)
Where's the mistake and what can I do? I cannot use early binding as there
are some users who do not have Visio installed. The missing typelibrary will
cause a error each time they start the database. Maybe my code is wrong in
an other line?
Thank you for any help,
Alex
I want to launch Vision 2003 and place a shape with VB(A) from MS-Access
2003
I do this:
1. Set reference to Visio 11 Type Library
2. Create a form with this code:
----------CODE
Dim VsoApp As Object
Dim VsoShape As Visio.Shape
Dim obj As Object
Dim VsoActivePage As Object
Set VsoApp = GetObject("", "Visio.Application")
VsoApp.Documents.AddEx "", visMSDefault, 0
VsoApp.Documents.OpenEx "periph_m.vss", visOpenRO + visOpenDocked
Set obj = VsoApp.Documents.Item("PERIPH_M.VSS").Masters.ItemU("Router")
Set VsoActivePage = VsoApp.Activepage
Set VsoShape = VsoActivePage.Drop(obj, 1, 1)
VsoShape.Characters = "Testchar"
VsoShape.NameU = "nameu Test"
VsoApp.Activepage.Layout
VsoApp.Quit
Set VsoApp = Nothing
-----CODE
I have already replace the "Dim ... as <visio datatype>" with OBJECT in
order to change from early binding to late binding.
Currently this code works fine! Now I replace the last line filled with
visio datatype:
Dim VsoShape As Visio.Shape with
Dim VsoShape As Object
and remove the reference to the visio type library.
But now the code wont run any more Visio still starts but I got at line
Set VsoShape = VsoActivePage.Drop(obj, 1, 1)
the runtime error 91 (and the german message: Objektvariable oder
With-Blockvariable nicht festgelegt)
Where's the mistake and what can I do? I cannot use early binding as there
are some users who do not have Visio installed. The missing typelibrary will
cause a error each time they start the database. Maybe my code is wrong in
an other line?
Thank you for any help,
Alex