+ Reply to Thread
Results 1 to 6 of 6

'Paste Special' problem with macro

Hybrid View

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    omaha
    Posts
    4

    'Paste Special' problem with macro

    I have a macro that copies the main report sheet in my workbook. The point of the macro is to get a copy of the report data without allowing anyone to see the formulas/data behind it - when it pastes, it pastes only the values in the tables and then copies the charts, deletes the live ones, and pastes only the images back on the sheet. The macro works on my computer and my partner's computer, but not on anyone else's. It stops at this point:
     ActiveSheet.PasteSpecial Format:="Picture (PNG)", Link:=False, _
            DisplayAsIcon:=False
    and either gives them a runtime error or Excel stops working entirely (interestingly, this differs based on what type of computer they use).

    Why does this happen? Does it have something to do with Excel settings?
    Last edited by royUK; 11-14-2008 at 03:53 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Please read the Forum Rules & use Code Tags in future.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why don't you just use sheet protection, you can choose to hide formulas

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    omaha
    Posts
    4
    Apologies, I'll use code tags in the future.

    We don't use the hide feature for the reports page because some recipients need to be able to see formulas in case they have questions about the data, which is included on other sheets. The macro also only copies a certain part of the page, which is a convenience for recipients. So there is no reason the VBA code shouldn't be working?

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello katmc,

    Most likely the PNG format is not part of the other computers basic clipboard formats. Try using standard formats like bitmap, metafile, or enhanced metafile.

    Sincerely,
    Leith Ross

  6. #6
    Registered User
    Join Date
    11-03-2008
    Location
    omaha
    Posts
    4
    brilliant- this fixed the problem. Many thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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