Solved

Animation control

Posted on 2003-10-22
6
364 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 50

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 50

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 50

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

786 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