{"text_format":"1","workbook":"xlsx","n_sheets":3,"sheets":["Sheet1","Sheet2","Sheet3"],"not_rendered":{"charts":0,"images":0,"macros":1,"external_links":0,"defined_names":0,"comments":0,"pivot_tables":0},"unopened":[],"bounds":{"document_bytes":16777216,"sheet_cells":100000,"rows_first":2000,"rows_last":500,"rows_between":2000,"halvings":0,"cell_chars":16384,"cell_head_chars":4096},"cells_cut":0,"cells_raw":0,"read":"whole","date_system":"1900"}

{"sheet":"Sheet1","index":0,"n_rows":52,"n_cols":4,"rows_kept":52,"cut":false,"hidden":false,"merged":[]}
[1050,null,null,"Hi All,"]
[1400]
[0.6,null,null,"I have a sample spreadsheet (uploaded to this thread) in which I have 10 command buttons named 'Video 1' to 'Video 10'. Next to these buttons is a Windows Media Player Object."]
[null,null,null,"I require the code that upon clicking any of the video command buttons, the relevant video is opened and shown in the windows media object within the same sheet (sheet1)."]
[null,{"$f":"A1*A3","v":630}]
[null,{"$f":"A2*A3","v":840},null,"I'm sure the code for each button will be the same apart from the cmd button reference number/name and the link to the file to be played."]
[]
[null,null,null,"If we assume all the videos are called as per their buttons i.e. Video 1.wmv, Video 2.wmv ... Video 10.wmv; and the location of these files is under 'C:\\Films', can someone post up some code for button 'Video 1' making it clear which variables to change for linking to the different files."]
[]
[null,null,null,"Thanks in advance - I'm sure this is no doubt very simple for you guys!"]
[]
[null,null,null,"Cheers!"]
[]
[null,null,null,"Sub PlayVideo()"]
[null,null,null,"    Dim strFile As String"]
[null,null,null,"    "]
[null,null,null,"    strFile = \"C:\\Films\\\" & ActiveSheet.Shapes(Application.Caller).TextFrame.Characters.Text & \".wmv\""]
[null,null,null,"    If Len(Dir(strFile)) = 0 Then"]
[null,null,null,"        MsgBox \"Unable to locate file \" & strFile, vbExclamation"]
[null,null,null,"        Exit Sub"]
[null,null,null,"    End If"]
[null,null,null,"        "]
[null,null,null,"    ActiveSheet.Shapes(\"WindowsMediaPlayer1\").OLEFormat.Object.Object.URL = strFile"]
[null,null,null,"    "]
[null,null,null,"End Sub"]
[]
[null,null,null,"Option Explicit"]
[]
[null,null,null,"Declare Function SHELLEXECUTE Lib \"shell32.dll\" Alias _"]
[null,null,null,"                              \"ShellExecuteA\" (ByVal Hwnd As Long, ByVal _"]
[null,null,null,"                                                                   lpOperation As String, ByVal lpFile As _"]
[null,null,null,"                                                                                          String, ByVal lpParameters As String, _"]
[null,null,null,"                                               ByVal lpDirectory As String, ByVal _"]
[null,null,null,"                                                                            nShowCmd As Long) As Long"]
[]
[null,null,null,"Declare Function GetForegroundWindow Lib \"user32\" () As Long"]
[]
[null,null,null,"Dim strMovie As String"]
[null,null,null,"Dim strPATHNAME As String"]
[]
[null,null,null,"Sub Movie1()"]
[null,null,null,"'attach to button 1"]
[null,null,null,"strMovie = \"Movie1.wmv\""]
[null,null,null,"End Sub"]
[null,null,null,"Sub startme()"]
[null,null,null,"   strPATHNAME = ThisWorkbook.Path & Application.PathSeparator"]
[null,null,null,"     SHELLEXECUTE GetForegroundWindow, \"Open\", strPATHNAME & strMovie, \"\", \"\", 1"]
[null,null,null,"  "]
[null,null,null,"End Sub"]
[null,null,null,"Sub OPENVIDEO()"]
[null,null,null,"    SHELLEXECUTE GetForegroundWindow, \"Open\", strPATHNAME & strMovie, \"\", \"\", 1"]
[null,null,null,"End Sub"]

{"sheet":"Sheet2","index":1,"n_rows":0,"n_cols":0,"rows_kept":0,"cut":false,"hidden":false,"merged":[]}

{"sheet":"Sheet3","index":2,"n_rows":0,"n_cols":0,"rows_kept":0,"cut":false,"hidden":false,"merged":[]}