Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Animation control

Posted on 2003-10-22
6
Medium Priority
?
388 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 53

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 53

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 53

Accepted Solution

by:
Ryan Chong earned 130 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…
Suggested Courses

715 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