Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2007: Error 400, Excel 2002: OK...
Hi, can somebody help me with this piece of code and tell me how I can
get it to work in both Excel 2002 and 2007? Sub Auto_Open() InsertPictureInRange "___URL_to_picture_on_the_net___", _ Range("G21:J29") End Sub Sub InsertPictureInRange(PictureFileName As String, TargetCells As Range) Dim p As Object, t As Double, l As Double, w As Double, h As Double If TypeName(ActiveSheet) < "Worksheet" Then Exit Sub Set p = ActiveSheet.Pictures.Insert(PictureFileName) With TargetCells t = .Top l = .Left w = .Offset(0, .Columns.Count).Left - .Left h = .Offset(.Rows.Count, 0).Top - .Top End With With p .Top = t .Left = l .Width = w .Height = h End With Set p = Nothing End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2007: Error 400, Excel 2002: OK...
The answer is :
http://support.microsoft.com/kb/928983/en-us 2007 no longer accepts loading images from URL. This article suggests you a workaround. Sharon " wrote: Hi, can somebody help me with this piece of code and tell me how I can get it to work in both Excel 2002 and 2007? Sub Auto_Open() InsertPictureInRange "___URL_to_picture_on_the_net___", _ Range("G21:J29") End Sub Sub InsertPictureInRange(PictureFileName As String, TargetCells As Range) Dim p As Object, t As Double, l As Double, w As Double, h As Double If TypeName(ActiveSheet) < "Worksheet" Then Exit Sub Set p = ActiveSheet.Pictures.Insert(PictureFileName) With TargetCells t = .Top l = .Left w = .Offset(0, .Columns.Count).Left - .Left h = .Offset(.Rows.Count, 0).Top - .Top End With With p .Top = t .Left = l .Width = w .Height = h End With Set p = Nothing End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2007: Error 400, Excel 2002: OK...
Thank you!
So "To work around this issue, code the VBA macro to insert the picture as a picture fill in a shape such as a rectangle." Could somebody please give me a brief guide as how to do this? BR, Josip |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2007: Error 400, Excel 2002: OK...
On Jun 17, 1:14*pm, wrote:
Thank you! So "To work around this issue, code the VBA macro to insert the picture as a picture fill in a shape such as a rectangle." Could somebody please give me a brief guide as how to do this? BR, Josip Just a tiny bump, I hope I can get some help on this. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2007: Error 400, Excel 2002: OK...
So a quick new question, if I have the code:
Sub Auto_Open() InsertPictureInRange "URL", _ Range("G21:J29") End Sub How can I take the "URL" as an input from a cell, for example A1? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 Hyperlink base removed when opening in Excel 2002 | Links and Linking in Excel | |||
personal.xls created in Excel 2007 and opened in Excel 2002 | Excel Discussion (Misc queries) | |||
Excel 2007 crashes with large linked Excel 2002 workbooks | Excel Discussion (Misc queries) | |||
Error when opening up file in Excel 2007, but not when opened withExcel 2002 | Excel Programming | |||
Excel 2002: How is the Excel 2007 file format open in Excel 2002 ? | Excel Discussion (Misc queries) |