Solved

Animation control

Posted on 2003-10-22
6
359 Views
Last Modified: 2013-12-26
Hi friends!
When I try to play some .avi files using vb animation control, an error message like " unable to open avi file " appears.The same file is opened and played by windows media player. Also some other .avi files are played using the same animation control without any trouble.What's wrong with those avi files(or with my animation
 control)?
0
Comment
Question by:vkani
  • 3
  • 2
6 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 9604577
>>unable to open avi file
Check your avi file path, since the error comes where the avi file is not found.

You may post your codes here too.

regards
0
 
LVL 1

Author Comment

by:vkani
ID: 9623178
dear ryancys,
when the path of the avi file is wrong, the error message will be 'file not found'.But I got the message as 'unable to open avi file.' I checked the path also & found it correct.
my code:

Private Sub Command1_Click()
   With Animation1
      .AutoPlay = True
      .Open ("d:\program files\microsoft visual studio\common\graphics\videos\fox.avi")
   End With
End Sub
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 9632931
I cant found then animation control you mean, however, you can try use the Windows Media Player Control:

Example:

Private Sub Command1_Click()
    With MediaPlayer1
        .AutoStart = True
        .FileName = "d:\program files\microsoft visual studio\common\graphics\videos\fox.avi"
        .Play
    End With
End Sub

Hope this helps
0
 
LVL 1

Author Comment

by:vkani
ID: 9720825
Sorry ryancys!
 It doesn't work! If I use 'mediaplayer1' ,I get 'Object required' error in that line!
0
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 65 total points
ID: 9747214
You need to import the Windows Media Player control from Component, have you done that before running the script?

regards
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now