Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default 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)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default 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
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default 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



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default 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
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I stop Excel from opening all files w/macros & running them BobC Excel Discussion (Misc queries) 4 April 5th 09 08:25 PM
Excel Files being opened on a Computer running Vista Daniel Excel Discussion (Misc queries) 1 February 9th 09 06:42 PM
Running Virus Scan Slowing down opening files Angelina Excel Discussion (Misc queries) 2 August 15th 05 12:41 AM
Excel files on local drives running from internet FillyFriend Excel Worksheet Functions 0 November 22nd 04 09:23 PM
running macros in downloaded files blueshot[_3_] Excel Programming 2 December 23rd 03 08:24 AM


All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"