Solved

Animation control

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

932 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

11 Experts available now in Live!

Get 1:1 Help Now