Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel 2003
I have found that Excel 2007 inserts pictures in a different way than Excel
2003. I noticed that Ron de Bruin commented in the thread how to add pictures to worksheet from url in Excel 2007 of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? Russ -- russ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel 2003
Hi Russ
Same problem here Maybe you can use this, OK in 2003 and 2007 Sub Tester() Dim myPict As Picture With ActiveCell Set myPict = .Parent.Pictures.Insert("C:\ron.png") myPict.Top = .Top myPict.Left = .Left End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Russ" wrote in message ... I have found that Excel 2007 inserts pictures in a different way than Excel 2003. I noticed that Ron de Bruin commented in the thread how to add pictures to worksheet from url in Excel 2007 of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? Russ -- russ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel 2003
Hi Ron,
Many thanks! That solved the problem. -- russ "Ron de Bruin" wrote: Hi Russ Same problem here Maybe you can use this, OK in 2003 and 2007 Sub Tester() Dim myPict As Picture With ActiveCell Set myPict = .Parent.Pictures.Insert("C:\ron.png") myPict.Top = .Top myPict.Left = .Left End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Russ" wrote in message ... I have found that Excel 2007 inserts pictures in a different way than Excel 2003. I noticed that Ron de Bruin commented in the thread how to add pictures to worksheet from url in Excel 2007 of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? Russ -- russ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel 2003
Russ
I have a similar problem. With excel 2003 my macro inserted a picture into a report at a range selected in the macro. In excel 2007 the macro always inserts the picture in the top left part of the worksheet. It ignores the range selected. With multiple pictures inserts in a nujmber of macros which run as a set, many pictures pile up on top of each other. When a picture is inserted manually, it appears where the cell pointer is located. Any ideas on how to fix the code - which I can provide if necessary. dickiebird "Russ" wrote: I have found that Excel 2007 inserts pictures in a different way than Excel 2003. I noticed that Ron de Bruin commented in the thread how to add pictures to worksheet from url in Excel 2007 of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? Russ -- russ |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel 2003
It's been awhile since I looked at the code and I am away from office until
next week. If you send me the code I will take a look next week when I get home. Russ -- russ "dickiebird" wrote: Russ I have a similar problem. With excel 2003 my macro inserted a picture into a report at a range selected in the macro. In excel 2007 the macro always inserts the picture in the top left part of the worksheet. It ignores the range selected. With multiple pictures inserts in a nujmber of macros which run as a set, many pictures pile up on top of each other. When a picture is inserted manually, it appears where the cell pointer is located. Any ideas on how to fix the code - which I can provide if necessary. dickiebird "Russ" wrote: I have found that Excel 2007 inserts pictures in a different way than Excel 2003. I noticed that Ron de Bruin commented in the thread how to add pictures to worksheet from url in Excel 2007 of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? Russ -- russ |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel 2003
And how should the code look, if the image is from the web?
"Ron de Bruin" skrev: Hi Russ Same problem here Maybe you can use this, OK in 2003 and 2007 Sub Tester() Dim myPict As Picture With ActiveCell Set myPict = .Parent.Pictures.Insert("C:\ron.png") myPict.Top = .Top myPict.Left = .Left End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Russ" wrote in message ... I have found that Excel 2007 inserts pictures in a different way than Excel 2003. I noticed that Ron de Bruin commented in the thread how to add pictures to worksheet from url in Excel 2007 of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? Russ -- russ |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel 2003
http://support.microsoft.com/kb/928983/en-us
I made this: Sub Makro3() Dim D As Range Dim H As Hyperlink On Error Resume Next For Each D In Selection If Err.Number = 438 Then Err.Clear MsgBox "Select some cells" End If For Each H In D.Hyperlinks If H.Name < "" Then If LCase(Left(H.Name, 4)) = "www." Then Adresse = "http://" & H.Name End If If LCase(Left(H.Name, 7)) = "http://" Then Adresse = H.Name End If On Error Resume Next If Adresse < "" Then With D Set myPict = ActiveSheet.Shapes.AddShape(msoShapeRectangle, D.Top, D.Left + D.Width, 100, 100) '(Adresse) myPict.Select Selection.ShapeRange.Fill.UserPicture (Adresse) End With If Err.Number = -2147467259 Then Err.Clear MsgBox "Image not found " & D.Address & "!" myPict.Delete GoTo Næste: End If D.Select End If End If Næste: Next Next End Sub Unfinished, but works. "akyhne" skrev: And how should the code look, if the image is from the web? "Ron de Bruin" skrev: Hi Russ Same problem here Maybe you can use this, OK in 2003 and 2007 Sub Tester() Dim myPict As Picture With ActiveCell Set myPict = .Parent.Pictures.Insert("C:\ron.png") myPict.Top = .Top myPict.Left = .Left End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Russ" wrote in message ... I have found that Excel 2007 inserts pictures in a different way than Excel 2003. I noticed that Ron de Bruin commented in the thread how to add pictures to worksheet from url in Excel 2007 of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? Russ -- russ |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel 2003
Hi, can somebody help me?
I have a macro inserting pictures from a local folder. Once the picture is inserted I scale it and move it to a cell. It worked perfect with Excel 2003 but it doesn't work very well with excel 2007. I assign to the picture the same coordinate than the cell where I can put it: Picture.Top = Cell.Top Picture.Left = Cell.Top On excel 2007 the picture moves upwards, and if the pictures are many, the last ones moves very much away from the cell. Even when I check the values of the picture and cell and those values match exactly. Please give me a clue where to look into. thank you "Russ" wrote: It's been awhile since I looked at the code and I am away from office until next week. If you send me the code I will take a look next week when I get home. Russ -- russ "dickiebird" wrote: Russ I have a similar problem. With excel 2003 my macro inserted a picture into a report at a range selected in the macro. In excel 2007 the macro always inserts the picture in the top left part of the worksheet. It ignores the range selected. With multiple pictures inserts in a nujmber of macros which run as a set, many pictures pile up on top of each other. When a picture is inserted manually, it appears where the cell pointer is located. Any ideas on how to fix the code - which I can provide if necessary. dickiebird "Russ" wrote: I have found that Excel 2007 inserts pictures in a different way than Excel 2003. I noticed that Ron de Bruin commented in the thread how to add pictures to worksheet from url in Excel 2007 of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? Russ -- russ |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel 2003
Ron,
I'm trying to do something similar. The only difference is, I am using automation from Access to insert the picture into an excel spreadsheet. Unfortunately, I'm getting run-time error 13, type mismatch, when it hits the line to Set myPict. Any ideas? -- -DinosRose "Ron de Bruin" wrote: Hi Russ Same problem here Maybe you can use this, OK in 2003 and 2007 Sub Tester() Dim myPict As Picture With ActiveCell Set myPict = .Parent.Pictures.Insert("C:\ron.png") myPict.Top = .Top myPict.Left = .Left End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Russ" wrote in message ... I have found that Excel 2007 inserts pictures in a different way than Excel 2003. I noticed that Ron de Bruin commented in the thread how to add pictures to worksheet from url in Excel 2007 of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? Russ -- russ |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel 2003
Okay, answer not necessary. I still couldn't get your solution to work but I
did find an alternate solution. ExcelObj.ActiveSheet.Pictures.Insert( _ "S:\PRR_Audit\RETAIL NETWORK AUDIT\TOOLS\Logos\New Logo 2007.bmp").Select ExcelObj.Selection.ShapeRange.LockAspectRatio = msoTrue ExcelObj.Selection.ShapeRange.Height = 51.75 ExcelObj.Selection.ShapeRange.Width = 191.25 ExcelObj.Selection.Top = 0 ExcelObj.Selection.Left = 0 ExcelObj.Selection.ShapeRange.Rotation = 0# I already had the code in to set the shaperange. I added .Top and .Left and it placed my logo in the upper left hand corner of the document instead of in the middle of nowhere (about 6 rows down and a column and a half in). I just have to hope that the placement works okay in Access 2003 as well. -- -DinosRose "DinosRose" wrote: Ron, I'm trying to do something similar. The only difference is, I am using automation from Access to insert the picture into an excel spreadsheet. Unfortunately, I'm getting run-time error 13, type mismatch, when it hits the line to Set myPict. Any ideas? -- -DinosRose "Ron de Bruin" wrote: Hi Russ Same problem here Maybe you can use this, OK in 2003 and 2007 Sub Tester() Dim myPict As Picture With ActiveCell Set myPict = .Parent.Pictures.Insert("C:\ron.png") myPict.Top = .Top myPict.Left = .Left End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Russ" wrote in message ... I have found that Excel 2007 inserts pictures in a different way than Excel 2003. I noticed that Ron de Bruin commented in the thread how to add pictures to worksheet from url in Excel 2007 of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? Russ -- russ |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert multiple pictures into excel 2007
Hello,
I am trying to insert multiple pictures from a folder (say JJPixs) into a spreadsheet. I tried to record a macro but insert picture didnt record in Excel 2007. I would like to have the number of each picture (file name, something like 1000 to 1125) sequentially listed in column B and have the macro fill in the corresponding picture centered in each cell of column A sized down to an equal size. If seems that if you want to include the pictures in a sort, they must be not overlapping any of the cells boundaries. Am I correct on that? I have forgotten some very basic macro/VB concepts so you wont insult me if you spell it out like I was a 3rd grader. I very much appreciate your help! |
#12
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel2003
I have found that Excel 2007 inserts pictures in a different way than Excel
2003. I noticed that Ron de Bruin commented in the thread how to add pictures to worksheet from url in Excel 2007 of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? |
#13
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting pictures in Excel 2007 different than in Excel 2003
Hi m gohil
I have found that Excel 2007 inserts pictures in a different way Correct you must use it like this This will work in 2003 and 2007 Dim myPict As Picture With ActiveCell Set myPict = .Parent.Pictures.Insert(filename) myPict.Top = .Top myPict.Left = .Left myPict.Placement = xlMoveAndSize End With pictures to worksheet from url in Excel 2007? of a possible bug in Excel This is a bug and not working -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "m gohil" wrote in message ... I have found that Excel 2007 inserts pictures in a different way than Excel 2003. I noticed that Ron de Bruin commented in the thread ?ohow to add pictures to worksheet from url in Excel 2007? of a possible bug in Excel which may relate to what I found. In Excel 2003 if you do Activesheet.Pictures.Insert (filename) The picture will be inserted in the upper left hand corner of the cell that is selected. In Excel 2007 the picture is inserted at a location that is independent of the selected cell. Has anyone else encountered this problem? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting pictures into Excel Sheet at a particular size | Excel Discussion (Misc queries) | |||
Can i configure excel 2007 to order pictures like excel 2003? | Excel Worksheet Functions | |||
Inserting pictures in Excel 2003 | Excel Discussion (Misc queries) | |||
Excel memory and speed when inserting pictures ??? | Excel Programming | |||
Problems inserting pictures in Excel 2002 sp-2 | Excel Discussion (Misc queries) |