Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use CreateObject?

Status
Not open for further replies.

LearningAsIGo

Technical User
Mar 17, 2008
18
US
I've been trying to figure out how to declare a CreateObject, but i don't know what to use for the statement or how to find it. Using what i found for Excel
Code:
Set AppExcel = CreateObject("Excel.Application")
I tried to use the same thing to create a Windows Media Player object with ("WMPlayer.Application"), but it was different
Code:
Set objPlayer = CreateObject("WMPlayer.OCX")
How do I know what to use in the CreataObject? is there a place i can check for the object refrence?
Thank you
 
Have you tried
Code:
Sub Main
    dim objPlayer as Object
    
    Set objPlayer = CreateObject("WMPlayer.OCX" )

objPlayer.url="c:\musicfiles\music.mp3"


End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top