Free Microsoft Excel 2013 Quick Reference

Paste picture from clipboard Results

Hi,
Just installed Office 2010.
When I press PrintScrn or ALT+PrintScrn >> move to an open WB and try to Paste the picture (which is, probably, located in the Comp. Clipboard) into whatever sheet -
I get this error:"Microsoft Excel cannot paste the data".
Pasting into a "Word" Document works like charm.
More than that - when I copy that pasted picture (from inside the document) it "agrees" to be pasted onto the WB Sheet.
Does anybody any clue ?
I am aware that the 2010 is a fresh beta version, "still warm from the oven", but maybe one of you faces a similar problem in one of the previous versions.
Thanks,
Elm

Hi... To ALL...

I get one macro that insert picture from disk to selected cell, then auto resize that picture to merged cell size.

But, now i intend to use that same code to PASTE a picture (from System Clipboard) then resize to merged cell size

PASTING to selected merged cell, it works fine...
But.. The resize,... Not that fine.

Here is the code i intend to use;


	VB:
	
 CommandButton1_Click() 
    Dim p As Picture 
    Application.ScreenUpdating = False 
     
    Set p = ActiveSheet.Pictures.Paste 
     
    If Target.Cells.Count = 1 Then Set Target = Target.MergeArea 
    With Target 
        p.Top = .Top 
        p.Left = .Left 
        p.Width = .Width 
    End With 
     
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines

I get ERROr in this line;

If Target.Cells.Count = 1 Then ...

Can someone help me in this...

THANKs

I am trying to copy from Excel 2000 as a picture and then paste into Word
2000 as a picture. My code will select the contiguous range, but when it
gets to this command:

Selection.CopyPicture Appearance:=xlScreen, Size:=xlScreen,
Format:=xlPicture

I get a run-time error 1004: Application-Defined or Object-Defined Error. I
haven't been able to determine which object is causing this error.

I tried earlier to simply copy the selection in Excel and PasteSpecial into
Word, but nothing seems to get pasted, even thought the code opens the
correct document. When the code finishes, I can manually paste the clipboard
contents, so I know it isn't empty.

Thanks to anyone who can help with this.

I am trying to copy a range as a picture from excel and paste that into a
picturebox on a form.

The code I am using to copy is
Globals.Profiles.Range("ProfileChart").CopyPicture(Excel.XlPictureAppearance.xlScreen,
Excel.XlCopyPictureFormat.xlPicture)

to paste the chart into a picturebox I first tried
Me.PictureBox1.Image = Clipboard.GetImage

That did not work and then I tried
Me.PictureBox1.Image =
DirectCast(Clipboard.GetDataObject().GetData(DataFormats.Bitmap, False),
Bitmap)

that did not work either.

I can paste the bitmap into any other application like word, excel or
outlook. When I query clipboard.containsimage I get false.

Please help !!!!!

Hi... To ALL...

I get one macro that insert picture from disk to selected cell, then auto resize that picture to merged cell size.

But, now i intend to use that same code to PASTE a picture (from System Clipboard) then resize to merged cell size

PASTING to selected merged cell, it works fine...
But.. The resize,... Not that fine.

Here is the code i intend to use;

Private Sub
CommandButton1_Click()
Dim p As Picture
 Application.ScreenUpdating = False
 
 Set p = ActiveSheet.Pictures.Paste

If Target.Cells.Count = 1 Then Set Target = Target.MergeArea
 With Target
 p.Top = .Top
 p.Left = .Left
 p.Width = .Width
  End With

End Sub

I get ERROr in this line;

If Target.Cells.Count = 1 Then ...

Can someone help me in this...

THANKs

Hi there, ive been looking all over the internet for answers to my problem but could find none.

I need to be able to copy a specific graph, in the form of an image, from a page. This image always has the same name, "itmu-cpu-generic-lastweek." I already have to code to create an instance of internet explorer and go to the page, but cannot find how to copy that one image and not the whole page.

I guess it does not really matter if it is copied to the clipboard or saved to the computer, as long as it is on my computer so that excel may grab it and throw it into a cell. Any help will be greatly appreciated

I have been reading and trying out alot of functions and I just can't seem to put them all together.

What I am looking to do, is have someone browse to a picture, select it, set it to a sheet, then every time the app is ran, load the image from the sheet.

I have seen how to load it from a set location (this won't work because it could be anywhere the user saved the picture at, and the picture could be named anything)

myDocument.Shapes.AddPicture _
"C:SomepathThePicture.jpg", _
True, True, 1, 1, 150, 150

This does great to get the image on the sheet.. but I need to browse to rather than have it hard coded...

Then... using Stephen Bullens pastepicture function.. I can get the image to the image control

ActiveSheet.Shapes("Picture 1").CopyPicture xlScreen, xlBitmap
'Paste the picture from the clipboard into our image control
Image1.Picture = PastePicture(xlBitmap)

But it wont save with the app.. so thats why I think it would have to be loaded onto a sheet and then called from on a user_form_initalize right?

So the question in the end is....

How do I browse to an image to load it to a worksheet, then is userform_initalize the right way to go to load it from the sheet every time ?

thanks!

Joe

Hi All ,

I have a simple VBA code as follwing.

Sub Test()
Sheets("Sheet1").Select
Sheets("Sheet1").Image1.Picture = LoadPicture("")
Sheets("Sheet1").Image1.Picture = LoadPicture("D:Pic1.jpg")

Range("A1:O18").Select
Range("A1:O18").CopyPicture Appearance:=xlScreen, Format:=xlPicture

Sheets("Sheet2").Select
Range("A1").Select
ActiveSheet.Paste
End Sub

I want to load picture name Pic1.jpg on Control toolbox(Image) that located in A1:O18 and then copy range A1:O18 as picture.

After that I paste from clipboard to sheet2. But why am I got a blank picture ?

Please help suggest....

Recently I had a need to make GIFs from embedded charts, with optional
resizing to any (within reason) user-specified scale factor. With
simple charts it's easy to just turn off screen updating, resize the
chart, make the GIF, put the chart back to its original size, and turn
screen updating back on. But with complicated charts having lots of
data labels, embedded text, and possibly other embedded shapes,
changing the size of the chart doesn't always give good results. Even
Auto scale fonts only scale in discrete steps, and custom-placed data
labels and other text doesn't stay in exactly the same relative
position when the chart size is changed.

So I snooped around on this ng. Harald Staff's XL2GIF macro gave me a
good start. After some additional tweaking I got what I wanted, and
when I was done I decided to duplicate the relevant code an put it
into a stand-alone utility. I'm happy to do a little payback by
making it available to readers. Here's what it does:

1. Assumes that an image (picture or bitmap) is already in the
clipboard. You can do a manual Shift > Edit > Copy Picture on a
chart, range of cells, or any shape such as Word Art, text boxes,
arrows, etc to make a clipboard copy. Or you can have some VBA code
do the Copy Picture for you; several examples are included. Or you
can use Alt-Print Screen to get a copy of the active window. Or you
can use the "Copy" function that many scientific and technical
programs have to make a bitmap copy of a plot or graph.

2. Pastes the clipboard image onto a temporary worksheet, optionally
resizes it using ScaleWidth and ScaleHeight, keeps track of the
dimensions, and (if necessary) copies the resized image back to the
clipboard.

3. Builds an empty chart and sets its size to exactly the same size
as the clipboard copy.

4. Pastes from the clipboard again, this time into the (empty) chart
area.

5. Adjusts the position of the pasted picture to make it line up with
the outside border of the overall chart, not with the slightly offset
chart area portion of the chart. This avoids the need to then have
any extra padding around the picture.

6. Exports the empty-except-for-the-picture chart as a GIF to a
user-specified file.

Available at www.qsl.net/ac6la/, look for the "Make a GIF" link. You
can use the utility as is or extract portions of the VBA code for your
own projects. If you are an image or clipboard guru (I'm not) you
might enjoy playing around with the ListClipboardFormats proc included
for debugging. Try selecting a single empty cell on a worksheet and
pressing Ctrl-C. You'll see that Excel has placed some 30-odd
different formats into the clipboard, most of which are a mystery to
me. All for a single empty cell!

Many thanks to Harald Staff, David McRitchie, and Stephen Bullen for
showing me the way.

Dan

Hello everybody,

I did a search on this and couldn't find anything so here goes...

I capture and paste alot of images into excel from the clipboard.
Once pasted i have to select "Format Picture" function in order
to get the size so that the pasted picture actually fits the excel
cells. Is there anyway to make the pasted pictures automatically
size themselfes to the cells ?

Or perhaps set a default setting in the "Size" tab in "Format Picture"
so that pasted pictures always gets the same size without me being
forced to write them in explicitly everytime ?

Thanks / Fal

How do I link picture files (e.g. PNG-files) in Excel so that they can be
automatically updated?

Did Microsoft forget to enable OLE-functions in Excel 2003 for graphics? I
tried several ways to paste the picture as a link, no success!
1) It is not possible to copy the pictures from Office Picture Manager into
Office Clipboard.
2) Copy into system clipboard works, but under paste special in Excel "paste
link" is inactive.
3) It's also not possible to link a picture file through: Insert/ Picture/
From file... which is possible in Word 2003.
4) Insert/ Object/ Create from file... doesn't show the picture but an icon,
although "Link to file" is checked. It links the file as "package" instead of
e.g. "paint.picture"

Thanks in advance!

I want to use VBA (and maybe some variation of the ActiveSheet.Paste
command?) to paste the image on the clipboard into Excel under a certain name
i.e. "samplepicture". I have tried "ActiveSheet.Paste.samplepicture" and
"ActiveSheet.Shapes("samplepicture").Paste" but can't seem to find a good
syntax.

I want to use VBA (and maybe some variation of the ActiveSheet.Paste
command?) to paste the image on the clipboard into Excel under a certain name
i.e. "samplepicture". I have tried "ActiveSheet.Paste.samplepicture" and
"ActiveSheet.Shapes("samplepicture").Paste" but can't seem to find a good
syntax.

Hi,
Please can somebody help me on how to call MS paint from MS excel (2003) and paste the picture in clipboard to paint and save the file in paint. I succeeded in activating Paint from excel, but no way I could pass the picture in clipboard to paint or save the paint file from excel. Following is the macro I wrote in VBA and it is not working.

Sub EditPics()
 Selection.Copy
 TheEditor = "D:WINDOWSsystem32mspaint.exe"
 TaskId = Shell(TheEditor, 1)
 AppActivate TaskId
 Application.SendKeys "^{V}", True
 Application.SendKeys "^{S}", True
End Sub


how can I programatically save a picture in the clipboard into a jpg
file? I can't paste the pic into a spreadsheet, but the pic needs to be
saved directly from the clipboard. Alex

I've run into a problem. I have been copying (from the web, paint and other tabs in excel) and pasting pictures into excel. At one point, I right clicked on a photo on the internet and when I went to paste it into excel, it gave me the last picture I copied. No matter how many times I copied it, it wouldn't paste it, it would only paste the last picture.

When I click to view my clip board, the correct photo is there. When I click on the photo I want, it STILL gives me the old one. Even when I clear the clipboard and copy and paste the new picture it STILL gives me the old one, and ITS NO LONGER ON THE CLIPBOARD!

Can anyone help me on this? If I close out excel and reopen it, it will work correctly for the first picture. Then, that is the only picture it will paste no matter how many other pictures I copy.

How do I link picture files (e.g. PNG-files) in Excel so that they can be
automatically updated?

Did Microsoft forget to enable OLE-functions in Excel 2003 for graphics? I
tried several ways to paste the picture as a link, no success!
1) It is not possible to copy the pictures from Office Picture Manager into
Office Clipboard.
2) Copy into system clipboard works, but under paste special in Excel "paste
link" is inactive.
3) It's also not possible to link a picture file through: Insert/ Picture/
From file... which is possible in Word 2003.
4) Insert/ Object/ Create from file... doesn't show the picture but an icon,
although "Link to file" is checked. It links the file as "package" instead of
e.g. "paint.picture"

Thanks in advance!

Hi,
Please can somebody help me on how to call MS paint from MS excel (2003) and paste the picture in clipboard to paint and save the file in paint. Following is the macro I wrote in VBA and it is not working.
Sub EditPics()
 Selection.Copy
 TheEditor = "D:WINDOWSsystem32mspaint.exe"
 TaskId = Shell(TheEditor, 1)
 AppActivate TaskId
 Application.SendKeys "^{V}", True
 Application.SendKeys "^{S}", True
End Sub


I'm deleting a picture from an Excel sheet, pasting a new picture in and saving. Each time I do this the file size increases more and more. I've been using the most recently saved sheet each time and now all the sheets I have saved today are upwards of 3 MB each.

Any ideas why this might be?

I've verified that sharing is off on the sheets. I even turned it on and back off to see if that changed anything. I looked at the clipboard, nothing saves with the files. I compressed the pictures that are in the files but no change.

Thanks for any help,

David

Hi,

I am writing a C# application (.NET 3.5) to perform the following:

1. Create a number of worksheets in an Excel 2007 workbook, each worksheet containing charts and associated text. The charts are created using the ChartWizard of the object model.
2. Copy the charts and associated text as images and paste them on slides in a PowerPoint 2007 template

I am attempting to do this via automation. The problem I am encountering is as follows:

1. On a single worksheet, I have four charts, each with associated text (in the cells around the chart objects). I need to copy each chart, with its associated text, and paste each into a separate PowerPoint slide.
2. I define a "Range" object to return the area encompassing the chart and its associated text. e.g. Worksheet.get_Range("A1", "N20")
3. I then use the Range.CopyPicture() method to copy the contents of the range to the clipboard.
4. Finally, I use the Slide.Shapes.Paste() method to paste the picture from the clipboard to a PowerPoint slide.

This only works for the first of the four charts (or ranges). That is, only the first chart is copied along with its text and pasted as is on the slide. For the remaining three charts, only the corresponding text is pasted on the slide; the charts themselves are missing.

Could someone please help me with this?

Thanks a lot.


No luck finding an answer? You could always try Google.