Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default 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

--







































  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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

--









































  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default 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

--











































  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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

--













































  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default 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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default 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....




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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....






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default 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.


Reply
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
Is the Excel Version Number Embedded in a File Tim Childs Excel Discussion (Misc queries) 2 April 26th 07 07:02 AM
Playing a embedded wav file when excel opens Waving Hello Excel Discussion (Misc queries) 1 April 14th 06 08:27 PM
swf flash file embedded in html file which is edited in excel.. he I Believe Excel Discussion (Misc queries) 0 June 16th 05 10:06 PM
Help needed referencing an embedded file teepee Excel Discussion (Misc queries) 0 April 24th 05 12:03 PM
Trying to get/set contents of embedded file using Excel OleObject Rich[_22_] Excel Programming 1 April 15th 04 07:21 AM


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

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

About Us

"It's about Microsoft Excel"