Newbie 101 / Alternatives to "Drop"

T

TazNTig

Hey there,

2 points of interest:

1. I have a solid history with developing VBA in Excel to get it to do
what I want. I'm branching over to Visio 2003 Technical now and am
attempting to handle this beast. Any suggested reading materials?
Googling for items has come up pitifully short-handed unfortunately.

2. Ultimate goal of what I am currently working on is a loop which
steps through an Excel spreadsheet of events and build a timeline in
Visio that includes each event.

So far, in my limited Visio VBA experience I have only found "drop" as
a useful method for inserting new shapes. Downside to this is it
provides a popup to the user running the macro asking them to fill in
the attributes.

The preferable behavior would be that the new shape gets inserted and
then its attributes are obtained from the XL sheet object and adjusted
in subsequent VBA statements.

Any guidance on useful alternative methods for inserting shapes into a
page?

Thanks!
 
J

junethesecond

Best reading materials, i think, is the Help of visio2003.
And some auxiliary reference may be msdn library searched with the key
words.
 
T

TazNTig

Thank you...

I saw that entry and basically stole the code that was posted and tried
implementing it here as a baseline.

I also, being the industrious thief, I guess I am, I also stole the
code from
http://groups-beta.google.com/group..._doneTitle=Back+to+Search&&d#7845228723d148ef
here to help continue to format the timeline. Unfortunately, my
timeline appears with a (proper) start date and a (proper) end date,
but no "mile markers" along the way.

When I "configure timeline", the select option for "Time Scale" is
properly set to "Months" and if I click "Ok" at this point, the "mile
markers" appear as I would expect.

Any thoughts as to why it takes manual interaction to get them to come
out?

The code I'm using to do this is:
(Oh, and btw, because I'm not very solid with understanding the roles
and responsibilities of the "DoEvents" method and the Addon.Run
command, I have cut and pasted them all over creation to get this
timeline to appear properly. So their current placement _should_ not
be held against a succesful test.)

-----

Dim objAddOn As Visio.Addon
Set objAddOn = Visio.Addons("ts")

Set stn = Application.Documents("TIMELN_U.VSS")
Set mstr = stn.Masters("Ruler timeline")

Application.EventsEnabled = False

Set rlrobj = ActivePage.Drop(mstr, 5.5, 2)

DoEvents

If (Err.Number <> 0) Then
MsgBox (Err.Description)
Exit Sub
End If

rlrobj.Cells("user.visbegindate") = 37987
rlrobj.Cells("user.visenddate") = 38352

DoEvents

objAddOn.Run ("")
Application.AlertResponse = 1
objAddOn.Run ("/cmd=3")
Application.AlertResponse = 0

If rlrobj.CellExists("user.vistimescale", False) Then
Set objCell = rlrobj.Cells("user.vistimescale")
objCell.Formula = 5
End If

If (rlrobj.CellExists("user.visminortimescale", False)) Then
Set objCell = rlrobj.Cells("user.visminortimescale")
objCell.Formula = 5
End If

DoEvents

objAddOn.Run ("")
Application.AlertResponse = 1
objAddOn.Run ("/cmd=3")
Application.AlertResponse = 0
Application.EventsEnabled = True

TIA,
Lorin
 
T

TazNTig

Also... milestones seem to ignore this macro created timeline.

Until I manually configure the created timeline, milestones just sit on
top of it but do not directly connect or interact with it.

Thoughts?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top