Animation Using Visio & VBA

I'd like to move an icon (named shIcon) from point A to B, and I can do so by 
adding in a 1-second delay between moves. The way I've done it is:

  With shIcon
    dx = 0.1 * (xLoc - .Cells("pinX"))
    dy = 0.1 * (yLoc - .Cells("pinY"))
    For i = 1 To 10
      dt1 = Now + 1 / 86400
' Next 3 lines create a 1-second delay (not the best way to do it, but it 
works)
      Do Until Now >= dt1
        dx = dx
      Loop
      .Cells("pinX") = .Cells("pinX") + dx
      .Cells("pinY") = .Cells("pinY") + dy
    Next i
  End With

However, I don't see the icon moving across the page, since it just shows 
the first and last points. How can I make the move visible?

TIA,
Mike
0
MikeM (74)
9/20/2006 6:04:02 PM
visio 3638 articles. 1 followers. Follow

4 Replies
1032 Views

Similar Articles

[PageSpeed] 44

Call DoEvents after your delay so any pending events are processed.

On Wed, 20 Sep 2006 11:04:02 -0700, MikeM
<MikeM@discussions.microsoft.com> wrote:

>I'd like to move an icon (named shIcon) from point A to B, and I can do so by 
>adding in a 1-second delay between moves. The way I've done it is:
>
>  With shIcon
>    dx = 0.1 * (xLoc - .Cells("pinX"))
>    dy = 0.1 * (yLoc - .Cells("pinY"))
>    For i = 1 To 10
>      dt1 = Now + 1 / 86400
>' Next 3 lines create a 1-second delay (not the best way to do it, but it 
>works)
>      Do Until Now >= dt1
>        dx = dx
>      Loop
>      .Cells("pinX") = .Cells("pinX") + dx
>      .Cells("pinY") = .Cells("pinY") + dy
>    Next i
>  End With
>
>However, I don't see the icon moving across the page, since it just shows 
>the first and last points. How can I make the move visible?
>
>TIA,
>Mike
0
andy.wagg (8)
9/20/2006 7:25:00 PM
Thanks, Andy. Is there any way of programming in a delay other than the 
kludge-y way I've done it?

Mike

"MikeM" wrote:

> I'd like to move an icon (named shIcon) from point A to B, and I can do so by 
> adding in a 1-second delay between moves. The way I've done it is:
> 
>   With shIcon
>     dx = 0.1 * (xLoc - .Cells("pinX"))
>     dy = 0.1 * (yLoc - .Cells("pinY"))
>     For i = 1 To 10
>       dt1 = Now + 1 / 86400
> ' Next 3 lines create a 1-second delay (not the best way to do it, but it 
> works)
>       Do Until Now >= dt1
>         dx = dx
>       Loop
>       .Cells("pinX") = .Cells("pinX") + dx
>       .Cells("pinY") = .Cells("pinY") + dy
>     Next i
>   End With
> 
> However, I don't see the icon moving across the page, since it just shows 
> the first and last points. How can I make the move visible?
> 
> TIA,
> Mike
0
MikeM (74)
9/21/2006 12:01:01 AM
With VBA, there is no easy way to set upa timer.

Graham Wideman's book, Visio 2003 Developer's Survival Pack, has a chapter 
on animation and provides a VSL to help with the timing.

If you are getting seriously into Visio development, DVS (Developing Visio 
Solutions from Microsoft Press/MSDN) and Graham's book are must haves.

John...    Visio MVP

Need stencils or ideas? http://visio.mvps.org/3rdparty.htm
Need VBA examples?   http://visio.mvps.org/VBA.htm
Visio Wishlist       http://visio.mvps.org/wish_list.htm

"MikeM" <MikeM@discussions.microsoft.com> wrote in message 
news:83526404-871C-4D43-9622-5406D179DF5B@microsoft.com...
> Thanks, Andy. Is there any way of programming in a delay other than the
> kludge-y way I've done it?
>
> Mike
>
> "MikeM" wrote:
>
>> I'd like to move an icon (named shIcon) from point A to B, and I can do 
>> so by
>> adding in a 1-second delay between moves. The way I've done it is:
>>
>>   With shIcon
>>     dx = 0.1 * (xLoc - .Cells("pinX"))
>>     dy = 0.1 * (yLoc - .Cells("pinY"))
>>     For i = 1 To 10
>>       dt1 = Now + 1 / 86400
>> ' Next 3 lines create a 1-second delay (not the best way to do it, but it
>> works)
>>       Do Until Now >= dt1
>>         dx = dx
>>       Loop
>>       .Cells("pinX") = .Cells("pinX") + dx
>>       .Cells("pinY") = .Cells("pinY") + dy
>>     Next i
>>   End With
>>
>> However, I don't see the icon moving across the page, since it just shows
>> the first and last points. How can I make the move visible?
>>
>> TIA,
>> Mike 


0
lancucki (505)
9/21/2006 12:35:50 PM
Thanks, John. I'll get it.

Mike

"John Marshall, MVP" wrote:

> With VBA, there is no easy way to set upa timer.
> 
> Graham Wideman's book, Visio 2003 Developer's Survival Pack, has a chapter 
> on animation and provides a VSL to help with the timing.
> 
> If you are getting seriously into Visio development, DVS (Developing Visio 
> Solutions from Microsoft Press/MSDN) and Graham's book are must haves.
> 
> John...    Visio MVP
> 
> Need stencils or ideas? http://visio.mvps.org/3rdparty.htm
> Need VBA examples?   http://visio.mvps.org/VBA.htm
> Visio Wishlist       http://visio.mvps.org/wish_list.htm
> 
> "MikeM" <MikeM@discussions.microsoft.com> wrote in message 
> news:83526404-871C-4D43-9622-5406D179DF5B@microsoft.com...
> > Thanks, Andy. Is there any way of programming in a delay other than the
> > kludge-y way I've done it?
> >
> > Mike
> >
> > "MikeM" wrote:
> >
> >> I'd like to move an icon (named shIcon) from point A to B, and I can do 
> >> so by
> >> adding in a 1-second delay between moves. The way I've done it is:
> >>
> >>   With shIcon
> >>     dx = 0.1 * (xLoc - .Cells("pinX"))
> >>     dy = 0.1 * (yLoc - .Cells("pinY"))
> >>     For i = 1 To 10
> >>       dt1 = Now + 1 / 86400
> >> ' Next 3 lines create a 1-second delay (not the best way to do it, but it
> >> works)
> >>       Do Until Now >= dt1
> >>         dx = dx
> >>       Loop
> >>       .Cells("pinX") = .Cells("pinX") + dx
> >>       .Cells("pinY") = .Cells("pinY") + dy
> >>     Next i
> >>   End With
> >>
> >> However, I don't see the icon moving across the page, since it just shows
> >> the first and last points. How can I make the move visible?
> >>
> >> TIA,
> >> Mike 
> 
> 

0
MikeM (74)
9/21/2006 1:10:02 PM
Reply:

Similar Artilces:

Using VBA to set footer
I have the following code to setup a footer: Sub DateFooter() With Worksheets("sheet2").PageSetup .LeftFooter = UCase(Format(Date, "dddd mmmm d, yyyy")) End With End Sub In the code, how do I make it Bold Arial 10? Thank you for your help. Steven -- HTH RP (remove nothere from the email address if mailing direct) "Steven" <Steven@discussions.microsoft.com> wrote in message news:6A5DC320-84CB-49F0-A12D-62CF69629BB0@microsoft.com... > I have the following code to setup a footer: > > Sub DateFooter() > > W...

Using Infozip
Hi All I read that someone has created a wrapper class for the Infozip dll's. But nowadays the link is dead. Can someone please provide me with this class anyway. Thanks in advance //Mikae l try this: ftp://ftp.uu.net/graphics/png/src/zlib113.zip AliR. "mikael andersson" <mikael.andersson@hotmail.com> wrote in message news:e1PNhSMFFHA.2296@TK2MSFTNGP15.phx.gbl... > Hi All > > I read that someone has created a wrapper class for the Infozip dll's. > > But nowadays the link is dead. > > Can someone please provide me with this class anyway. &...

how to add ( and ) when using function sum
want to add 1+2+3 = (6) how do to it? =SUM(1,2,3) -- Regards, Peo Sjoblom "Sulasno" <sulasnoXXX@hotmail.com> wrote in message news:%23CbFRWW8HHA.5360@TK2MSFTNGP03.phx.gbl... > want to add 1+2+3 = (6) > > how do to it? > =sum(1,2,3) -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "Sulasno" <sulasnoXXX@hotmail.com> wrote in message news:%23CbFRWW8HHA.5360@TK2MSFTNGP03.phx.gbl... > want to add 1+2+3 = (6) > > how do to it? > Hi Sulasno, A few different ways, In cell A1 type =1+2+3 a...

Using Exchange only for public folders
Is it possible to configure Exchange users (using Outlook) so that they use a POP3 - SMTP server for sending and receiving e-mail message (using a .pst local file) and Exchange just to access shared folders? Regards Mario Marius - Rome wrote: > Is it possible to configure Exchange users (using Outlook) so that > they use a POP3 - SMTP server for sending and receiving e-mail > message (using a .pst local file) and Exchange just to access shared > folders? Regards > Mario Yes, kinda - not for internal mail, tho. And PST files are a bad idea. Why do you want this configuration?...

animation in outlook 2000
I receive mail all the time that has anmatied art in it. Each tiem i attemp to send an email messge by inserting an anmited clip the clip becomes a still picture. What meus be done to maintina the animation? Set your email format to HTML. (Tools | Options | Mail Format) Open a new message. Click in the body of the message. Select INSERT from the menu Select PICTURE... Browse to an animated jpg or gif file and select it or Set your email format to HTML (Tools | Options | Mail Format) Open a new message Click in the body of the message Find an animated picture on a web site or suc...

How to check if a certain function is used
Hi What's the best way to check if a certain spreadsheet function is used in a cell? For instance, we want to check if cell A1 uses SUM function considering that A1 may contain: 1. A1 ="Sum" 2. A1 =SUM(B1:B2) 3. A1 =If(A1="Sum","True",SUM(B1:B2)) These is not a complete list of possibilities. I just wanted to show that search a formula string for certain words is not the best solution. Any ideas? Kind regards IgorM Sub dk() MsgBox Range("B2").Formula End Sub Will give you the formula used in B2. "IgorM" &...

Animated chart
Jon Peltier recently posted an article called "Gas Price Interactive Time Series" on his blog. Can anyone please explain how the animation works? The chart plots the data in the first two rows of the data sheet. The scroll bar under the chart is linked to cell A1 in the data sheet. This corresponds to the row of the data list which is listed in row 2 of the data sheet and plotted in the chart. The first row of the data sheet contains series names, which do not change. The second row extracts the values from the proper row using this formula: cell B2: =INDEX(B$9:B$808,$A$1) ...

using conditional formatting with dates
I have a spreadsheet using excel 2003. I need the row to be one color if a box is filled in with specific text. I have that. I now have 2 conditions left to use. I need the row to turn one color when the date in the box is between now and 30 days from now. Then I need it to turn another color when that same date in the box is past. I think i have the coloring down but my blank cells change color. is there any way to avoid this? For your third condition you are probably using a CF formula like this: =3Dcell<NOW() You can change this to: =3DAND(cell<NOW(),cell<>...

DO YOU USE A PASSWORD (IE) PASSPORT IN MONEY?
I have been a Microsoft Money user since 1995 and have updated the product annually. I have NEVER allowed a password on my Money files. I do NOT link my files onto the internet servers. My Money program is strickly on MY personal computer. I do allow downloads of investment information weekly, but most everything else is entered manually.I DO utilize my bank and credit card company's web site and phones to verify and maintain my daily account balances for those items. I intend to maintain this posture, at least for the coming year. While I do occasionally have some problems with the prog...

not sure if I'm using the correct formula for the result I want
I'm trying to calculate a 'low net' score. A persons 'actual score' minus 'their handicap' = 'low net' score. I have this worksheet setup like this; A4:A23 = list of names Columns B-U have the weekly calculated low net scores B4:U23 = the calculated 'low net' scores using this formula =SUM(Scorecard!B4-Scorecard!Y4); (this is for player one) Scorecard!B4 is player one's first week 'actual score', Scorecard!Y4 is player one's calculated 'handicap'. In Row B25:U25 I have this formula {=MIN(IF(B$4:B$23>0,B$4:B$23))}, to p...

Error when importing VBA customizations
On some Windows XP SP2 workstations, when I import a customization/form with VBA, the Windows installer for Microsoft Office XP starts up saying "Please wait while Windows configures Microsoft Office XP Professional", and after a few seconds, I get a Dynamics.exe crash (Dexterity Runtime--send error report/don't send options). The only thing that appears to cause this is if I install GP before installing Office, but now that it's too late for that (I tried uninstalling both programs, running a registry cleaner, and then reinstalling but that didn't help) does anyo...

why won't animations move in outlook 2007 emails
-- thank you Keith mole <kjmsafe-pot@yahoo.co.uk> wrote: <nothing> Because Microsoft removed the ability to display anomation from Outlook 2007. -- Brian Tillman Outlook 2007 does not support animated GIFs anymore due to tighter security handling. Patrick Schmid [OneNote MVP] -------------- http://pschmid.net *** Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80 *** Customize Office 2007: http://pschmid.net/office2007/customize RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer OneNote 2007: http://pschmid.net/office2007/onenote *** Subsc...

Use XPath functions in selectNodes
Hi I tried to use the following C#-code to run a XPath-query using "ends-with" which is defined in the XPath-functions namespace see: http://www.w3schools.com/xpath/xpath_functions.asp //xmlDoc is a valid XmlDocument that contains lots of children, also //root is 'real' node, although not the document-root. XmlNode root = xmlDoc.DocumentElement.SelectSingleNode("H1"); System.Xml.XmlNamespaceManager xmlnsManager = new System.Xml.XmlNamespaceManager (this.xmlDoc.NameTable); //Add the namespaces used in books.xml to the XmlNamespaceManager. xmlnsManage...

using Excel as a database
can someone point me in the right direction here... I would like to have a workbook with, say, 2 sheets. the first would be a form, for a user to enter data into different cells. I would like to be able to have that data then added to a table (database) on the other worksheet. So, for example, if 5 people enter info in the first sheet (one at a time), the table on sheet 2 will have 5 new roes added to it. I'm basically looking to have a very small database setup. Alternatively, I could create a VBA form, and use that for entry, but I'm not sure how to set it up so it adds to the dat...

Useful toolbar
Download the oneclik toolbar and browse the web within a click or two. Its quite useful and whats more it works with both Internet Explorer and Mozilla Firefox Download it by following the link.It only takes a minute to download and install http://oneclik.communitytoolbars.com ...

Using the IN keyword in an simple CASE statement
Hi, Is it possible to convert this into a simple case statement and retain the use of the IN keyword Case When InvoiceAllocation.SourceType in ('S','C') Then Coalesce(TimeCat.Description+' ','')+Coalesce(TimeSCat.Description,'') When InvoiceAllocation.SourceType in ('F') Then 'Free Item' When InvoiceAllocation.SourceType in ('A') Then 'Adjustment' Else 'Sales Tax' End, As you can see, i had to use a Searched CASE because of the IN keyword in the first WHEN. Without doing a s...

some of my email att. say error opening data base 2000 I use outl.
some of my email att. say error opening data base 2000 I use outlook. imdp2u <imdp2u@discussions.microsoft.com> wrote: > some of my email att. say error opening data base 2000 I use outlook. Let me se if I understand your post. "When I attempt to open some of my email attachments I receive the error message 'error opening data base 2000'. I use Outook." Is that correct? Assuming it is, I'd say you have a problem not with Outlook but with the installation of whatever database the attachments require. Have you tried saving them to disk prior to opening t...

WEBSITE ANIMATIONS
Im trying to create a website with an animation but when I try to insert it (through the tool-bar) it won't let me. I created the animation in Macromedia flash, could that be why it's not working? -- AC Using a SWF file (Flash) in Publisher http://msmvps.com/blogs/dbartosik/articles/81253.aspx -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Andrew" <Andrew@discussions.microsoft.com> wrote in message news:7AA7D80D-E91A-4BFB-B684-4483EBCCC36E@microsoft.com... > Im trying to create a website with an anim...

Saving and Sharing with VBA
Hello, The following is a code I've made with help of several people and using the record macro function in Excel. It does everything I want it to do, BUT save and share. I've tried different things but nothing seems to work. So I need help on how to get my file to when it's done with what it is doing, save the worksheet, and share it. So far when I run it, it gets down to the save part and a box will pop up saying are you sure you want to save because there is a file with that name already. I click yes, it "saves". Then I'll close it and open it bac...

Macro Sort (VBA?)
Hi All Trying to run a macro for a sort. If fixed column - not a problem, but I want the macro to sort if column month tally's with B1 E.g. if Month 1-3-06 then sorts column D if 1-4-06 sorts column E etc. I have created a little formula that high-lights the current month - i.e. =IF($B$1=D5,"COLUMN /\","") if that helps? A B C D E Enter Current Month 01/03/2006 Start THEN CLICK BELOW RUN SORT ROUTINE COLUMN/\ HELP Point Name BRANCH 01/02/2006 01/03/2006 01/04/...

Functions in VBA
In a particular situation, I wanted to calculate several values on a worksheet through a macro. But, I find that some of the vital functions are not available in VBA. For example - LEN() is not available in VBA. Is there any workaround for this? Second question - again on fundamental VBA. A1=10 A2=15 B1=5 B2=20 Sometimes, when I check through VBA if Range("A1")+Range("A2") = Range("B1")+Range("B2") this condition evaluates to false, because either of the values would be something like 25.000000000000000178 or something like that. (Then I check the va...

Animation query
I have created a slide in PowerPoint 2007 where to the left I have 4 bullet points and to the right I have inserted 4 pictures in association to the bullet points. I am trying to animate the slide so that I get bullet point 1 come in then picture 1, Bullet 2 then picture 2 etc. However, I am able to get all the bullets to come in 1,2,3,4 etc then the pictures 5,6,7,8. But if I try to move the first picture to come in after the first bullet the picture takes up number 1 spot then all the bullets. To resume, I can't seem to seperate the bullets to allow a picture to come ...

How to use wincrypt.h?
Hi: I use it in a console app. I do this: The first I don't include .h file. Then add #define _WIN32_WINNT 0x0400 and #include <wincrypt.h> in the stdafx.h. compile ... error: error C2146: syntax error : missing ';' before identifier 'HRESULT' fatal error C1004: unexpected end of file found How to do? thanks! >error C2146: syntax error : missing ';' before identifier 'HRESULT' >fatal error C1004: unexpected end of file found > >How to do? Try adding #include <windows.h> before. Dave Thank you. "David Lowndes" ...

Using a range in Sum Function
I have run across an oddity in Exel 2010 Trial Edition. If I define a range to be cells c1, d1, f1 and g1 using the Name Manager and then put the following in another cell: =Sum(range name), the function returns the proper value. BUT, each time I open the worksheet after just viewing it (not changing anything), Excel asks me if I want to save the changes. I didn't make any changes so why should it ask me that? Is there a solution to this? Thank you. Do you have something in a header or footer that deals with current time or date? -- JoAnn Paules MVP M...

use animated text or animated clip art
how can I use animated text or animated clipart in publisher? Only if you are creating a web page. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com http://officebeta.iponet.net/en-us/publisher/FX100649111033.aspx "Patty" <Patty@discussions.microsoft.com> wrote in message news:0FA23101-2A3D-4AED-A759-883F3A3C9F8B@microsoft.com... > how can I use animated text or animated clipart in publisher? I thought as much - thought I was missing something - thanks. I find it odd I can use animations in Word, but not publis...