drom
Well-known Member
- Joined
- Mar 20, 2005
- Messages
- 543
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
Hi and thanks in advance !!
I have a range with website images on it eg:
Both images are existing images (if I copy and paste the lines in google you can see the images)
However I do not know why when trying to paste the images 48 in a cell (the second line) I CANT
Any IDEA whats going wrong, what am I missing??
I have a range with website images on it eg:
Both images are existing images (if I copy and paste the lines in google you can see the images)
However I do not know why when trying to paste the images 48 in a cell (the second line) I CANT
- https://casdocs.com/CASAS/21271015-47.jpg
- Goes fine, I get no problems
- https://casdocs.com/CASAS/21271019-48.jpg
- Does not go fine, I am not able to insert the picture on my excel sheet
VBA Code:
Sub mToInsertURLpicture()
On Error Resume Next: Application.ScreenUpdating = False
Dim WKBvba As Workbook: Set WKBvba = ThisWorkbook
Dim WKBactive As Workbook: Set WKBactive = ActiveWorkbook
Dim wActSht As String: wActSht = ActiveSheet.Name
Dim rCell As Range: Set rCell = ActiveCell
Dim wURL As String: wURL = rCell
Dim Pic As Picture
Dim Shp As Shape
Err.Clear
'rCell.Select
If wURL <> "" Then
If Left(LCase(wURL), 4) = "http" Then '://" Or Left(LCase(wURL), 8) = "https://" Then
Err.Clear
Set Pic = Nothing: Set Pic = WKBactive.Sheets(wActSht).Pictures.Insert(wURL)
'If Err <> 0 Then
If Pic Is Nothing Then
rCell.Offset(, 1) = "Wrong"
Else
rCell.Offset(, 1) = "OK"
End If
End If
End If
When Activecell
End Sub
Any IDEA whats going wrong, what am I missing??