ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running .avi files (https://www.excelbanter.com/excel-programming/297781-running-avi-files.html)

David

Running .avi files
 
Greetings and TIA for your help
Anyone got VBA code sugestions for opening and running a Windows AVI file from and excel macro? (Would like to run in full screen mode and automatically close and return to Excel at the end of the clip)

Michel Pierron[_2_]

Running .avi files
 
Hi David,
Private Declare Function mciSendString Lib "winmm.dll" _
Alias "mciSendStringA" (ByVal lpstrCommand As String _
, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long _
, ByVal hwndCallback As Long) As Long

Sub FullScreenAvi()
Const aviFile = "C:\Clock.avi" ' Modify as appropriate
Dim Cmd As String
Cmd = "play " & aviFile & " fullscreen "
mciSendString Cmd, 0&, 0, 0&
End Sub

Regards;
MP

"David" a écrit dans le message de
...
Greetings and TIA for your help.
Anyone got VBA code sugestions for opening and running a Windows AVI file from

and excel macro? (Would like to run in full screen mode and automatically close
and return to Excel at the end of the clip)



David

Running .avi files
 
Michael
Thanks for your respons
When I run this macro nothing happens (no error messages). It just runs & quits without running the .avi file
Would be grateful if you could have another look (does it run ok on your system?
Thanks again

Michel Pierron[_2_]

Running .avi files
 
Hi David,
Yes, this macro run ok on my system (Win98 + xl2002) but y only tested it with
small avi (<500ko).
Regards,
MP

"David" a écrit dans le message de
...
Michael,
Thanks for your response
When I run this macro nothing happens (no error messages). It just runs & quits

without running the .avi file.
Would be grateful if you could have another look (does it run ok on your

system?)
Thanks again




Michel Pierron[_2_]

Running .avi files
 
Hi David,
I tested with WinXP and that work too.
MP

"David" a écrit dans le message de
...
Michael,
Thanks for your response
When I run this macro nothing happens (no error messages). It just runs & quits

without running the .avi file.
Would be grateful if you could have another look (does it run ok on your

system?)
Thanks again




ste mac

Running .avi files
 
Hey guys....

I have been following your thread and the AVI macro is fantastic....

Do you have one that will run in a child window, whereas the spreadsheet
is visible while it runs.... thanks..

seya ste

Michel Pierron

Running .avi files
 
Hi ste mac,
' In standard module:
Public Play As Boolean
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As String, ByVal uReturnLength _
As Long, ByVal hwndCallback As Long) As Long
Private Returnstring As String

Sub AVI_Play()
Const FileName As String = "c:\mybestfile.avi"
If Dir(FileName) = "" Then Exit Sub
If Play Then AVI_Stop
Returnstring = Space(127)
mciSendString "open " & Chr(34) & FileName & Chr(34) _
& " type avivideo alias video", Returnstring, 127, 0
mciSendString "set video time format ms", Returnstring, 127, 0
mciSendString "play video from 0", Returnstring, 127, 0
Play = True
End Sub

Sub AVI_Stop()
mciSendString "close video", Returnstring, 127, 0
Play = False
End Sub

'In ThisWorkbook module:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Play Then AVI_Stop
End Sub

Regards,
MP

"ste mac" a écrit dans le message de
om...
Hey guys....

I have been following your thread and the AVI macro is fantastic....

Do you have one that will run in a child window, whereas the spreadsheet
is visible while it runs.... thanks..

seya ste




ste mac

Running .avi files
 
Michel, thankyou very much for you macro, just what I needed...

I will use it right away...

I didn't know you had answered my post! for some reason my page didn't refresh
and I have posted a question based on you macro to this newsgroup, so don't
be surprised if you see another post refeering to your code <g

Thanks Michel

seeya ste

ross

Running .avi files
 
Code does not work on m
excel 97 sp
win2000 sp 4
will try at home of diff rig,
nice code though


All times are GMT +1. The time now is 02:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com