Need help referencing an embedded file in Excel
Hello - might I ask help of the experts here please?
I have a macro in a spreadsheet that references back to a video file (Mfile= "test.avi") I want to e-mail the spreadsheet to a friend but in order to do so, she will have to separately copy the file test.avi to her c drive to make the macro function. This is inconvenientas she is not computer literate. Obviously I can embed the file test.avi into the spreadsheet as an object, but how can I change the VB code to directly reference it. I'm no VB expert, so any help would be appreciated Best TP -- |
Need help referencing an embedded file in Excel
For example:
Sheet1.OLEObjects("Object 1") You can determine the name of the object by clicking on it and looking at the Name Box (to the left of the Formula Bar). -- Vasant "teepee" wrote in message ... Hello - might I ask help of the experts here please? I have a macro in a spreadsheet that references back to a video file (Mfile= "test.avi") I want to e-mail the spreadsheet to a friend but in order to do so, she will have to separately copy the file test.avi to her c drive to make the macro function. This is inconvenientas she is not computer literate. Obviously I can embed the file test.avi into the spreadsheet as an object, but how can I change the VB code to directly reference it. I'm no VB expert, so any help would be appreciated Best TP -- |
Need help referencing an embedded file in Excel
Thanks so much for replying Vasant
So what's the syntax if it's object 6928? I tried ... Mfile = Sheet1.OLEObjects("Object 6928") ....but that didn't work. Sorry I'm ignorant of vb syntax tp "Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message ... For example: Sheet1.OLEObjects("Object 1") You can determine the name of the object by clicking on it and looking at the Name Box (to the left of the Formula Bar). -- Vasant "teepee" wrote in message ... Hello - might I ask help of the experts here please? I have a macro in a spreadsheet that references back to a video file (Mfile= "test.avi") I want to e-mail the spreadsheet to a friend but in order to do so, she will have to separately copy the file test.avi to her c drive to make the macro function. This is inconvenientas she is not computer literate. Obviously I can embed the file test.avi into the spreadsheet as an object, but how can I change the VB code to directly reference it. I'm no VB expert, so any help would be appreciated Best TP -- |
Need help referencing an embedded file in Excel
Dim Mfile As Object
Set Mfile = Sheet1.OLEObjects("Object 6928") -- Vasant "teepee" wrote in message ... Thanks so much for replying Vasant So what's the syntax if it's object 6928? I tried ... Mfile = Sheet1.OLEObjects("Object 6928") ...but that didn't work. Sorry I'm ignorant of vb syntax tp "Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message ... For example: Sheet1.OLEObjects("Object 1") You can determine the name of the object by clicking on it and looking at the Name Box (to the left of the Formula Bar). -- Vasant "teepee" wrote in message ... Hello - might I ask help of the experts here please? I have a macro in a spreadsheet that references back to a video file (Mfile= "test.avi") I want to e-mail the spreadsheet to a friend but in order to do so, she will have to separately copy the file test.avi to her c drive to make the macro function. This is inconvenientas she is not computer literate. Obviously I can embed the file test.avi into the spreadsheet as an object, but how can I change the VB code to directly reference it. I'm no VB expert, so any help would be appreciated Best TP -- |
Need help referencing an embedded file in Excel
"Vasant Nanavati" wrote... Dim Mfile As Object Set Mfile = Sheet1.OLEObjects("Object 6928") Hmm no luck The whole subcommand for this button now reads Private Sub CommandButton1_Click() Dim Mfile As Object Set Mfile = Results.OLEObjects("Object 6928") MP.Open (Mfile) End Sub (results being the name of the sheet and media player being what opens it) It says runtime error 424 object required |
Need help referencing an embedded file in Excel
This worked for me:
Sub PlayIt() Dim Mfile As Object Set Mfile = Worksheets("Results").OLEObjects("Object 6928") Mfile.Verb End Sub -- Vasant "teepee" wrote in message ... "Vasant Nanavati" wrote... Dim Mfile As Object Set Mfile = Sheet1.OLEObjects("Object 6928") Hmm no luck The whole subcommand for this button now reads Private Sub CommandButton1_Click() Dim Mfile As Object Set Mfile = Results.OLEObjects("Object 6928") MP.Open (Mfile) End Sub (results being the name of the sheet and media player being what opens it) It says runtime error 424 object required |
Need help referencing an embedded file in Excel
"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message ... This worked for me: Sub PlayIt() Dim Mfile As Object Set Mfile = Worksheets("Results").OLEObjects("Object 6928") Mfile.Verb End Sub Heh thanks for trying. it's appreciated. That one opened it but as a completely separate file using my normal default player- not with the embedded windows media player as I need it to. You see the windows media player timer position is one of the inputs to the spreadsheet 8-) Oh well - back to the drawing board.... |
Need help referencing an embedded file in Excel
I think you've lost me. When I ran the code my video file played as an
embedded file on the Excel worksheet, and not as a separate file in Media Player. I'm using Win2K Pro and Excel XP. -- Vasant "teepee" wrote in message ... "Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message ... This worked for me: Sub PlayIt() Dim Mfile As Object Set Mfile = Worksheets("Results").OLEObjects("Object 6928") Mfile.Verb End Sub Heh thanks for trying. it's appreciated. That one opened it but as a completely separate file using my normal default player- not with the embedded windows media player as I need it to. You see the windows media player timer position is one of the inputs to the spreadsheet 8-) Oh well - back to the drawing board.... |
Need help referencing an embedded file in Excel
"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote I think you've lost me. When I ran the code my video file played as an embedded file on the Excel worksheet, and not as a separate file in Media Player. I'm using Win2K Pro and Excel XP. Yes it's hard to explain. I've e-mailed you the spreadsheet so you'll see what I mean. |
All times are GMT +1. The time now is 08:37 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com