Sorry to be stuck on this

NewbieMan

New Member
Joined
Nov 25, 2017
Messages
33
I know this should be easy but for some..not so much for me

have this code..

Code:
Public Sub LaunchGame_Click()


If ChooseYourGameBox.Value = "Game1" Then
ArcadeGames.Movie = "http://www.Game1.swf"


ElseIf ChooseYourGameBox.Value = "Game2t" Then
ArcadeGames.Movie = "http://www.Game2.swf"
End If

Code is supposed to work as follows. I have a combobox named ChooseYourGameBox with a list of games. User picks a game. The command button (named LaunchGame) then should look at what is written in the combox box and load in the appropriate game for the user when it is pressed. That works great the first time. But then if you choose a different game and click the command button to load in a different game it doesnt do anything. So if i pick Game1 and hit the command button its loaded in fine, but then when i want to play something different after, say, Game2 and hit the command button nothing is happening..can someone please correct and if possible please explain (if possible) why this would be the case?

Thanks
 
Last edited:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I suspect that the problem lies with the ArcadeGames object. If it is a user defined class, I'd wonder if the .Movie method clears the existing game before loading a new one.
 
Upvote 0
I suspect that the problem lies with the ArcadeGames object. If it is a user defined class, I'd wonder if the .Movie method clears the existing game before loading a new one.

I dont know. Would there be a workaround? Maybe adding a second command button that would "force" a reset? I tried resetting the command button that launches the game but that had no impact. Or is it possible to add a little code at the end of each if to sort of "force" this to be reset? Any help would be appreciated.
Thanks again.
 
Upvote 0
Movie is not a property or a method in the VBA object model. Your ArcadeGames variable must be of a custom data class. Without seeing the code for that custom class, it would be impossible to suggest a work-around or a reset code.
 
Upvote 0

Forum statistics

Threads
1,216,026
Messages
6,128,363
Members
449,444
Latest member
abitrandom82

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top