LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Nested Forms & SendKeys

Why not use a suitable control on your userform to play the file instead of
Shell/SendKeys. Then you have full control over play/stop etc.
Maybe the MS MultiMedia control .

Don't know if it is worth it for you, but there is also the Speech
capability of the Windows SAPI, or Excel Speech in versions 2002 and up.
That way you can "play" any arbitrary text, without the recorded file.
I can't say how efficient/effective either method would be.

NickHK

"Phil1982" wrote in message
...
Hi...Could you see if you can spot where I'm going wrong please

I need to produce a 100 word presentation on why I should be chosen for

the
finance job I applied for. They've said they want you to be creative.

Excel
VBA is a valued skill in this job.

I have created a main Form with 3 buttons titled: Experience,

Achievements,
Values we share.

I've then created 3 corresponding minor forms. Each one has a label where

I
have described my Experience, Achievements or Values. Each one also has a
close button.

When one of the 3 main Form buttons is pressed and the corresponding minor
form/answer opens, I have told it to play a particular MP3 file. When the
user clicks the close button on the minor form, ***I am trying to tell it

to
close Windows Media Player and the minor form***

I have got it to play the MP3 file, but when I click the close button, the
macro comes up with Run-time error 5 and the debug highlights the
"AppActivate PlayFile" line in the code I have copied below:

---------------
If I right click on MainForm, then ViewCode.....this is SOME of the code
I've done

Sub WhyMeButtonA_Click()
PlayFile = Shell( _
"C:\Program Files\Windows Media Player\wmplayer.exe ""C:\Documents and
Settings\Phil\Desktop\Music Files\Worktogether.mp3", 1)

ExperienceForm.Show

End Sub
-----------------------
If I right click on ExperienceForm, then ViewCode.....this is ALL the code
I've done

Sub CommandButton1_Click()
Unload ExperienceForm
AppActivate PlayFile
SendKeys "^w", True
End Sub
-----------------------

I guess I'm not understanding something about nested Forms.

Any help would be appreciated.

Thank you

Phil1982



 
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
nested if based on nested if in seperate sheet. how? scouserabbit Excel Worksheet Functions 5 March 2nd 07 04:03 PM
Excel forms - authorise / deny forms Ian Manning Excel Programming 1 May 8th 06 05:03 PM
Always Sendkeys... Duncan[_5_] Excel Programming 0 May 4th 06 09:10 AM
RefEdits and normal forms / forms in a DLL David Welch Excel Programming 0 December 1st 04 03:49 PM
Calling Forms from Forms - Exit problems Stuart[_5_] Excel Programming 3 May 25th 04 06:50 AM


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

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

About Us

"It's about Microsoft Excel"