Urls using instructions

Ansh

New Member
Joined
Aug 3, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Web
Hi
can you please guide me how to execute this kind of function or how to use in excel dev.

Sub ImageExists()
Dim aPic() As Byte
Dim objWin As Object
Const strUrl As String = "http://upload.wikimedia.org/wikipedia/commons/2/22/Turkish_Van_Cat.jpg"
Dim ImageExists As Boolean

Set objWin = CreateObject("WinHttp.WinHttpRequest.5.1")
On Error Resume Next
With objWin
.Open "GET", strUrl, False
.Send
aPic = .ResponseBody
End With
Set objWin = Nothing


ImageExists = (InStr(StrConv(aPic, vbUnicode), "404 Not Found") = 0) And (Err.Number = 0)
End Sub
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi,
To make it work, you need to place the code into a standard module.
Press Alt +F11 at the same time so that Visual Basic Editor opens.
Press Alt, I, M to insert a new standard module.
Now you can run the procedure from Macros in the Code section in the Developer tab.
Note:
The Developer tab isn't displayed by default, but you can add it to the ribbon.
1. On the File tab, go to Options > Customize Ribbon.
2. Under Customize the Ribbon and under Main Tabs, select the Developer check box.
 
Upvote 0
Oh, I didn't notice your question has been posted in Questions in Other Languages. It's a forum for posting questions other than English.

To moderators:
Better move this thread to the Excel Questions forum.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top