+ Reply to Thread
Results 1 to 4 of 4

Exporting an object from a worksheet to the Computer Desktop

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    Peoria, Arizona
    MS-Off Ver
    Excel 2013
    Posts
    39

    Exporting an object from a worksheet to the Computer Desktop

    Happy Friday everyone

    I have been working on code to create shortcut with a custom icon with code. What I am having a problem with is getting the custom icon, which is saved to Sheet 1 as an object, to the computer desktop. I thought the easiest way to do this would be to select the object, copy it and paste it to the desktop. Easy enough, but I am having a real problem finding the path to the desktop to execute the sendkey command to paste. Would any of you have a solution to this?

    Sub ExportObject()

    ActiveSheet.Shapes.Range(Array("Object 2")).Select
    Selection.Copy


    'TargetPath = Desktop

    SendKeys "^v"

    End Sub

    Another solution would be to simply export the object but I would have no idea on how to do this either.

    Any help would be greatly appreciated

  2. #2
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    365
    Posts
    16,926

    Re: Exporting an object from a worksheet to the Computer Desktop

    You need to be more specific about what you want to do. You cannot copy a shape and paste it to the desktop.

    Do you want to export your shape as an image file (e.g., JPG) and save that file to the desktop? That still will not give you a shortcut using a custom icon, just an image file.

    It would help if you gave a complete explanation of what you want to do. Excel may not be the best way to do it.

  3. #3
    Registered User
    Join Date
    09-20-2012
    Location
    Peoria, Arizona
    MS-Off Ver
    Excel 2013
    Posts
    39

    Re: Exporting an object from a worksheet to the Computer Desktop

    Thanks for responding. I have other code to create the shortcut and to assign the custom icon to the shortcut, but it needs to be on the desktop in order to work. So I need to export the object (which is a .ico file called Icon.ico) to the desktop and the other macro will find the ico file and assign it to the shortcut. Since I have solved the second macro, i did not include it. Would it be helpful if I added it to give a clearer picture? Thanks

  4. #4
    Registered User
    Join Date
    09-20-2012
    Location
    Peoria, Arizona
    MS-Off Ver
    Excel 2013
    Posts
    39

    Re: Exporting an object from a worksheet to the Computer Desktop

    Just in case, here is the macro in its entirety. Special thanks to Christos Samaras who wrote the bulk of this macro and is so credited. As you can see, I only need to get the object (.ico object) to the desktop and the rest of the macro will then create a shortcut, find the icon, and apply it to the new shortcut. The trick is to get the .ico file from the worksheet to the desktop for the rest of the macro to find it. I hope this helps. If I can get this to work, this will be a really neat trick.

    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 03-05-2016 at 09:07 AM. Reason: Wanted to abide by forum rules and input [Code] / fixed tag error--6SJ

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Opening a worksheet from a shortcut on desktop
    By Mickmac in forum Excel General
    Replies: 3
    Last Post: 11-25-2012, 05:06 AM
  2. VBA Export worksheet to CSV and save on desktop
    By jph89 in forum Excel General
    Replies: 0
    Last Post: 08-30-2012, 11:55 AM
  3. [SOLVED] Save to any computer desktop
    By fremarco in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-20-2012, 11:26 AM
  4. [SOLVED] Can I make a Excel Active Desktop Worksheet on XP?
    By Garett in forum Excel General
    Replies: 1
    Last Post: 07-10-2006, 12:44 PM
  5. Using Object model to start an instance of excel on another computer?
    By P in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2006, 04:40 PM
  6. Saving Worksheet Picture on desktop using VBA??
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2006, 01:39 PM
  7. working Excel worksheet on the astive DESKTOP
    By Colin2u in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2005, 07:05 PM
  8. How do i set up my desktop computer to work from my laptop
    By juliek in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-26-2005, 12:54 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1