Hi

I want to create an Excel instance, copy a picture from my html page and
paste it into the Excel instance. Is this possible?

Se example below of what I'm trying to do (the copy part doesn't work
though):


Dim xlApp
Dim xlW
Dim xlS

Set xlApp = CreateObject( "Excel.Application" )
Set xlW = xlApp.Workbooks.Add
Set xlS = xlW.Worksheets.Add

myPicture.Copy
xlS.Paste


Regards
PO

Re: Copy an image by mr_unreliable

mr_unreliable
Fri Mar 11 16:53:31 CST 2005

hi PO,

Do you have a copy of "your web page" on your system, or would you be
downloading it???

(It would make a difference in how you go about this)...

cheers, jw

PO wrote:
> Hi
>
> I want to create an Excel instance, copy a picture from my html page and
> paste it into the Excel instance. Is this possible?
>
> Se example below of what I'm trying to do (the copy part doesn't work
> though):
>
>
> Dim xlApp
> Dim xlW
> Dim xlS
>
> Set xlApp = CreateObject( "Excel.Application" )
> Set xlW = xlApp.Workbooks.Add
> Set xlS = xlW.Worksheets.Add
>
> myPicture.Copy
> xlS.Paste
>
>
> Regards
> PO
>
>

Re: Copy an image by PO

PO
Fri Mar 11 17:56:14 CST 2005

Hi

The page is downloaded from our company webserver.

/PO


"mr_unreliable" <kindlyReplyToNewsgroup@notmail.com> wrote in message
news:#huNevoJFHA.3788@tk2msftngp13.phx.gbl...
> hi PO,
>
> Do you have a copy of "your web page" on your system, or would you be
> downloading it???
>
> (It would make a difference in how you go about this)...
>
> cheers, jw
>
> PO wrote:
> > Hi
> >
> > I want to create an Excel instance, copy a picture from my html page and
> > paste it into the Excel instance. Is this possible?
> >
> > Se example below of what I'm trying to do (the copy part doesn't work
> > though):
> >
> >
> > Dim xlApp
> > Dim xlW
> > Dim xlS
> >
> > Set xlApp = CreateObject( "Excel.Application" )
> > Set xlW = xlApp.Workbooks.Add
> > Set xlS = xlW.Worksheets.Add
> >
> > myPicture.Copy
> > xlS.Paste
> >
> >
> > Regards
> > PO
> >
> >



Re: Copy an image by Miyahn

Miyahn
Fri Mar 11 19:08:03 CST 2005

"PO" wrote in message news:epstyYpJFHA.3376@TK2MSFTNGP14.phx.gbl
> The page is downloaded from our company webserver.

Try this.
Copy all images from a web page by Excel-VBA.

Sub Test()
GetImgs "http://www.officetanaka.net/" ' example url
End Sub
'
Sub GetImgs(URL)
Dim aImg, Imgs, VPos: VPos = 10
With CreateObject("InternetExplorer.Application")
.Navigate URL
Do While .Busy: DoEvents: Loop
Set Imgs = .Document.Body.getElementsByTagName("IMG")
End With
Application.ScreenUpdating = False
With CreateObject("Scripting.Dictionary")
For Each aImg In Imgs
If Not .Exists(aImg.Src) Then
.Add aImg.Src, ""
With ActiveSheet.Pictures.Insert(aImg.Src)
.Top = VPos: .Left = 60: VPos = VPos + .Height + 5
End With
End If
Next
End With
Application.ScreenUpdating = True
End Sub

--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP for Microsoft Office - Excel(Jan 2005 - Dec 2005)
HQF03250@nifty.ne.jp