Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Image.Picture = LoadPicture("http://...")

This is probably simple, but the logic has slipped past me. How do I
load a picture into a control image from a website stored file?

This doesn't work:

Me.Image1.Picture = _
LoadPicture("http://www.somewebsite.com/pix/someimage.gif")

But entering "http://www.somewebsite.com/pix/someimage.gif" into the
Image Control Properties box for Picture does work.

Thank you for your ideas.

Phil

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Image.Picture = LoadPicture("http://...")

A good sample can be found on
http://www.wretch.cc/blog/crdotlin&article_id=8153261 which uses an
API-call.



Option Explicit

Private Type TGUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type

Private Declare Function OleLoadPicturePath Lib "oleaut32" _
(ByVal szURLorPath As Long, ByVal punkCaller As Long, ByVal
dwReserved As Long, _
ByVal clrReserved As OLE_COLOR, ByRef riid As TGUID, ByRef
ppvRet As IPicture) As Long


Public Function LoadPicture(ByVal strFileName As String) As IPicture
Dim IID As TGUID
With IID
.Data1 = &H7BF80980
.Data2 = &HBF32
.Data3 = &H101A
.Data4(0) = &H8B
.Data4(1) = &HBB
.Data4(2) = &H0
.Data4(3) = &HAA
.Data4(4) = &H0
.Data4(5) = &H30
.Data4(6) = &HC
.Data4(7) = &HAB
End With
On Error GoTo ERR_LINE
Set LoadPicture = stdole.LoadPicture(strFileName)
Exit Function
ERR_LINE:
On Error Resume Next
OleLoadPicturePath StrPtr(strFileName), 0&, 0&, 0&, IID, LoadPicture
If LoadPicture Is Nothing Then
MsgBox "Can not find " & strFileName
End
End If
End Function


Private Sub CommandButton1_Click()
Set Me.Image1.Picture = LoadPicture("http://your.image.here/")
End Sub











"Phil" schreef in bericht
oups.com...
This is probably simple, but the logic has slipped past me. How do I
load a picture into a control image from a website stored file?

This doesn't work:

Me.Image1.Picture = _
LoadPicture("http://www.somewebsite.com/pix/someimage.gif")

But entering "http://www.somewebsite.com/pix/someimage.gif" into the
Image Control Properties box for Picture does work.

Thank you for your ideas.

Phil



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
Automatically adding image extension ".jpg" to end of image name Alain Excel Discussion (Misc queries) 3 June 19th 08 03:21 PM
To block "to "eliminate" of the picture of form, information Isaac[_2_] Excel Programming 1 June 29th 06 05:49 PM
To block "to "eliminate" of the picture of form, information Isaac[_2_] Excel Programming 0 June 29th 06 04:34 PM
MSXML.DLL HTTP getAllResponseHeaders setRequestHeader "Cookie" Rick Excel Programming 0 October 25th 05 05:00 PM
VBA : A picture from http://.../Image.gif VUILLERMET Jacques Excel Programming 2 October 1st 03 09:24 PM


All times are GMT +1. The time now is 10:26 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"