mickyflash
12-03-2019, 06:08 AM
I have recently upgraded to Excel 365 from 2010 which I have used with no problem for many years.
I have this code which still works perfectly fine in 2010, but I am getting a 400 error message when I try and run the spreadsheet in 365
Is there an obvious reason why 365 does not like the code?
Public Sub Add_Images_To_Cells()
ActiveSheet.Pictures.DELETE
Dim lastRow As Long
Dim URLs As Range, URL As Range
With ActiveSheet
lastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Set URLs = .Range("A2")
End With
For Each URL In URLs
URL.Offset(0, 4).Select
URL.Parent.Pictures.Insert URL.Value
DoEvents
Next
End Sub
I have this code which still works perfectly fine in 2010, but I am getting a 400 error message when I try and run the spreadsheet in 365
Is there an obvious reason why 365 does not like the code?
Public Sub Add_Images_To_Cells()
ActiveSheet.Pictures.DELETE
Dim lastRow As Long
Dim URLs As Range, URL As Range
With ActiveSheet
lastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Set URLs = .Range("A2")
End With
For Each URL In URLs
URL.Offset(0, 4).Select
URL.Parent.Pictures.Insert URL.Value
DoEvents
Next
End Sub