Excel - save clipboard image to jpg?

I've got an several Excel reports which are generated on a monthly basis and I need to export a selected range as an image. I've managed to get as far as selecting the range and copying it to the clipboard, and pasting it into another application would work
but is it possible to save the image directly from the clipboard as a jpg file?
I've used the following code to do it looking at this link on poshcode:
http://poshcode.org/5184
$excel = New-Object -COM "Excel.Application" # Create new COM object
$excel.displayalerts = $false
$excel.visible = $true
$excel.usercontrol = $false # Disable user interaction with Excel
$Workbook=$excel.Workbooks.open($testfile) # Open XLS file in Excel
$Worksheet=$Workbook.Worksheets.Item(1)
$Worksheet.Activate() | Out-Null
add-type -an system.windows.forms
$rows = ($Worksheet.UsedRange.Rows.Count) # Get total used row count
$xRow = 1
$yRow = $rows
$rng = $Worksheet.range("b${xRow}:j${yRow}")
$pic = $rng.CopyPicture(2,1)
$e=[System.Windows.Forms.Clipboard]::GetDataObject()
$img = $e.GetImage()
$img.save($savefile)
It all runs and copies the selection to clipboard (pastes as image if you CTRL+V) but produces an error still on the last two lines. Cannot call a method on a null-valued expression.
Thanks in advance.

What about pasting it into Powerpoint and do SaveAs jpg?
Here is some vba code
' Initialize PowerPoint Object Library
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPPres.Slides(1).Shapes.Paste

Similar Messages

  • Can't save some images as .jpg

    Hi,
    I was wonder why I'm not able to save some img's in RGB mode, size about 10mgp as JPG.Just to use regular Save as? I know that I could go through Save for web.. but it's more steps but othervoce is the same?
    Thanks a lot
    Barbora

    barunkad wrote:
    So why 16 bit is imposible to save like that? because it has more information (like for print) then jpg need?
    Thnaks a lot.
    In Windows you can only print at 8-bit anyway.
    That is enough for most people.
    (Given 8 bits per channel, you get values from 0 to 255 to record the darkest to lightest intensities.  Since values of 0 to 255 can be recorded for all three color primaries (red, green, and blue) separately, the total number of colors that can be recorded is 256 x 256 x 256 or about 16.8 million colors.)

  • Photoshop saves images as jpg.lnk.  How do I stop that?  I just want jpg.  Cannot email jpg.lnk.

    In Photoshop I save an image as jpg, but it saves as jpg.lnk.
    This is a file that cannot be emailed.  It gets blocked as a dangerous file.
    How do I eliminate the ltd?
    Thank you,

    Hi,
    Only saw it in Outlook.
    Thats the only place it would show the file as jpg.lnk instead of just jpg.
    On Thu, Jan 29, 2015 at 7:16 AM, Silkrooster <[email protected]>

  • Save image as .jpg in the photoshop CC

    I was using Photoshop CS6 so I instaled Photoshop CC. Now I need to  save my images as .jpg in the photoshop but I don't know how to do it. May someone  help  me, please?

    It works the same as CS6. You can use save as or save for web. Just make sure your document mode is in RGB 8-bit. Otherwise you can not find jpg in the file types.
    Actually, either CS6 or CC they updated the jpg option so that it would convert a 16-bit image to 8-bit for you. But for reference, the file format it self only supports RGB 8-bit.

  • How to save a image with JSF and get your URL

    Hi
    I need to save a image to my file system and get your URL. I�m working with JSF.
    Ex.:
    1� Save a image Cup.jpg on the server
    2� Get your URL
    result: http://www.mysite.com/images/Cup.jpg
    Thanks!!!

    I don't understand what's the problem? Can you please elaborate? Show some code snippets and tell where you stucks on.

  • How do I resave RAW images as JPG?

    I have been taking all my photos in Nikon's RAW format and Leica's RAW format. For archival and exporting purposes I would like to resave some of these projects in JPG (leaving the orignal RAW format projects in tact). I'm guessing that this is easy to do - but it's not apparent to me.
    Thanks

    You want to save the images as JPG where? back in Aperture? to some external location?
    What you asking doesn't make sense from an Aperture standpoint. Your RAW images can be exported as JPG at anytime by doing an export version command. Thereis no way to turn a RAW image into a JPG and have it stored in Aperture without exporting the version and then re-importing it. But then it will have no connection to the original master it came from.
    So if you could explain ain more detail what it is you are trying to do we might be able to come up with an answer.
    regards

  • How to save an image to *.gif or jpg?

    Hello All,
    I'm stumbling upon another problem. I can save my displays as *.jpg file but it's very blurry, is there a better way to do this? My code as below:
    try
    OutputStream out = new FileOutputStream(new File("./outfile.jpg"));
    Image image = this.createImage(this.getWidth(),this.getHeight());
    Graphics g = image.getGraphics();
    this.paint(g);
    ImageIO.write((RenderedImage)image, "jpg", out);     
    out.flush();
    out.close();
    }catch(Exception ee) {}
    Any suggestion is greatly appreciative. Thanks in advance!

    Try looking at "Encoder" in the search - that should fix you up matey

  • How can I batch save my adjusted raw images as jpgs in Lightroom 4

    I have a job that I imported to Lightroom 4.  I made adjustments to 40 of the images and would like to batch save these as jpgs with the LR adjustments saved.  So far I know I can save the raws as jpgs but the adjustments are not being saved.  I would hate to have to open each image individually to save these changes.  Thanks for any help!

    Highlight the 40 images, and then open the export dialogue and set your options. There is no "save" option or "save as" option in Lightroom. Since Lightroom doesn't alter your original images, it is necessary to export derivative copies for whatever use you need.

  • Why won't my trial of CC Photoshop let me save my PSD images as JPG or GIF?

    Why won't my trial of CC Photoshop let me save my PSD images as JPG or GIF?

    One thing to check is that your PSD is RGB/8 or /16, but not /32  (32 bits per channel)
    If that is not the problem
    Let's try this:
    Close Adobe Photoshop if it is opened.
    Find the following:   (windows user can hit windows key + r, then in run cmd line type "%appdata%" to locate your "AppData\Roaming" directory)
    \AppData\Roaming\Adobe\Adobe Photoshop CC\Adobe Preferences CC Settings
    Rename the  "Adobe Preferences CC Settings" folder to "Adobe Preferences CC Settings_old"  so that preferences settings can be recreated.
    Reopen Photoshop CC and open a new or existing file to verify that your "save for web" option is back and not grayed out.

  • When I try to save an image firefox is automatically removing any image filetype (.jpg .png .bmp etc) and replacing it with .html

    Every time I try to save an image by right clicking and going save image as firefox is changing the filetype to .html
    It does it for every website and every image regardless of its file type. Even if you go to the direct link for the image and try to save it, it will save it as "image.htm" rather than "image.jpg" as it shows the file to be in the address bar.

    Try the Firefox SafeMode. <br />
    ''A troubleshooting mode, which disables most Add-ons.'' <br />
    ''(If you're not using it, switch to the Default Theme.)''
    # You can open the Firefox 4/5/6/7 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    # Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    If it is good in the Firefox SafeMode, your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

  • Can't "save as" camera raw images as jpgs

    Up until two days ago, I could open all my NEFS in PS, edit them to my liking and do a "save as" JPG. I want to maintain my original raw file. Now the FILE dropdown menu is completely grayed out and inaccessible.
    I can save the image (down in the left corner) but this just converts the edited NEF to a JPG...
    I haven't done any upgrades or made any other changes to my iMac. All my "old" NEFS (from more than 2 days ago) can no longer be "saved as" either.

    Here's a screen shot. the info at the bottom says it's 8 bit. I have put the cursor over the FILE menu so you can see it's not assessible.

  • Can't save images as jpg, jpeg, bmp, etc. only as Preview Document or All Files.

    I'm running Firefox 27.0 on OSX 10.9. When I try to save an image from a website I'm only given the option to save the file as a Preview Document or All Files. I cannot save the image as it exists on the website (ie. jpg, jpeg, gif.) Right now I'm saving as a Preview Document, opening that in preview and then exporting the file as an image. I'd like to just save the file directly from a website as an image rather than a Preview Document. How do I do this?

    Can't you give the file the correct file extension for that image (e.g. .jpg) when you save the file?
    Try to rename (or delete) the mimeTypes.rdf file in the Firefox profile folder to reset all file actions.
    *http://kb.mozillazine.org/mimeTypes.rdf
    *http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_actions

  • Can I save an image as a 16-bit RGB JPG file?

    Is it possible to save an image as a 16-bit RGB file? I know I can work in RGB mode in 16-bits per channel and "save as" a JPG, but when re-opening the file it appears to have been converted to 8-bit.  My research seems to show a consistent theme that JPG is by definition an 8-bit format.  Nonetheless, I have a supplier who wants their images delivered in 16-bit or 32-bit RGB in JPG format.  Is this possible. If not, what might they mean by this?

    Not possible. Jpg does not support anything higher than 8 bit. I believe png supports 16 bits per channel, other than that you could send a tiff file, but be prepared for any in compatibilities, you may need to change some settings and try again.

  • When i save any image from any website then there is no option showing in the save as box like saves as .jpg etc. In this case I manually add the extension of image for example .jpg .gif etc. Please solve my problem :(

    When i save any image from any website then there is no option showing in the save as box like saves as .jpg etc. In this case I manually add the extension of image for example .jpg .gif etc. Please solve my problem :(

    I'm guessing your problem is caused by code validation errors: orphaned division tags for example, or mismatched code and document type (i.e.  XHTML /> mixed with HTML > style closures).
    Start by using the code validation tools below and fix any reported.  You'll need an Internet connection for this:
    HTML Validator - http://validator.w3.org 
    CSS Validator - http://jigsaw.w3.org/css-validator/  
    HTML & CSS Tutorials - http://w3schools.com/
    If this doesn't solve the problem, you will need to post a URL to your live page so we can see your code and images working together.   Or at the very least copy and paste your HTML and CSS code into a reply using double arrows >> Syntax Highlighting > Plain.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Save as image

    Hi,
    I would like to modify the File Dialog so the user can select one format between 3 possible formats to save an image. For example the user has the choice to save its image as bmp OR jpg OR png.
    So far I could define the pattern file with FileDialog.vi but not properly. 
    Any help?
    Charly 
    Message Edited by CharlyStardust on 09-09-2008 04:26 PM
    It's always sunny in California! Certified LabVIEW Associate Developer!
    Attachments:
    Save file dialog.vi ‏139 KB
    FileDialog.jpg ‏44 KB

    Hi Mike,
    Thank you for the link. I have a better insight into FileDialog.vi now. According to Sam from LAVA forum. "This file dialog uses a windows com object to show your native file dialog. You can use it to show printer, color and other dialogs too, but the functionality has only been implemented for File selection."
    I have also found a similar post here.
    I have Windows XP SP2 that comes by default with the necessary ActiveX control (comdlg32.ocx). The point is I don't figure out how to 'load/link' the ActiveX control: I can see an error message saying "Control couldn't be loaded" and if I try to load it by myself (right-click->Insert ActiveX object->Microsoft Common Dialog Control, version 6.0 SP6) I get an error message. (see attachments)
    I noticed that the comdlg32.ocx from the LAVA forum is smaller in size than the one already installed on my computer.
    What can I do to make it working?
    Charly
    It's always sunny in California! Certified LabVIEW Associate Developer!
    Attachments:
    Clipboard-1.jpg ‏8 KB
    Clipboard-2.jpg ‏51 KB

Maybe you are looking for