Closed Thread
Results 1 to 2 of 2

Special Paste works fine Manually, BUT not in VBA! (Arrrghhh!)

  1. #1
    Registered User
    Join Date
    07-13-2017
    Location
    Puyallup, WA
    MS-Off Ver
    Excel for Mac (latest version)
    Posts
    26

    Special Paste works fine Manually, BUT not in VBA! (Arrrghhh!)

    Hi all!

    I am new to this forum, and this is my first post, so cut me some slack, because I'm a little nervous, albeit very excited!

    I have a simple problem in Excel regarding the special paste command. Specifically, if I try to do a special paste for a selection as a "picture" (although the same problem occurs if I special paste my selection as a "PDF"). Oddly, if I perform these steps manually, I have no problem, and it works fine. But if I attempt to use the VBA code that was generated in the macro-record, the vba compiler hangs up on the special paste command when I add it to my vba code!

    Here is the simple process I do manually that works fine.

    I "Select All", (within the active worksheet that I am on), then I "Copy", and finally I select a special paste command using the "Picture" option. It does exactly what I want it to do. All of my individual graphs, plots, spread sheets, etc, from that sheet, are now saved as one solid picture.

    But if I attempt to implement the same command in VBA, then my program crashes on the "Special Paste" command.

    The code looks like this:

    Sub PasteTest()

    ActiveSheet.Shapes.SelectAll
    Selection.Copy
    ThemeEffectScheme.PasteSpecial Format:="Picture", Link:=False, _
    DisplayAsIcon:=False

    End Sub

    For some reason, the vba compiler crashes on the following line, even though this same command works fine when done manually!

    ThemeEffectScheme.PasteSpecial Format:="Picture", Link:=False, _
    DisplayAsIcon:=False

    Can somebody please, please, please, help me! It's been driving me nuts!

    I just retired from Boeing. I'm an engineer, and I am working on an automated spreadsheet that will help people on the ketosis diet.

    I really hope somebody can help me, because I can usually figure this stuff out using trial and error, but not tonight! Tonight, the clowns that live within my head (and sleep under my bed!), are all mocking me, and laughing out loud... with their big fat clown feet!

    Regards, Tony
    Last edited by tony333; 07-14-2017 at 11:05 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Special Paste works fine Manually, BUT not in VBA! (Arrrghhh!)

    Duplicate thread closed. Please continue in your original thread here: https://www.excelforum.com/excel-pro...-arrrghhh.html
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel for Mac: Special Paste works fine Manually, BUT not in VBA! (Arrrghhh!)
    By tony333 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 15
    Last Post: 07-15-2017, 05:28 AM
  2. [SOLVED] Help with modifying VBA Macro - Works fine but needs fine tuning !
    By stefan27 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-06-2015, 10:27 AM
  3. [SOLVED] Advanced Filter Macro does not work, running manually works fine
    By jamiemc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-09-2013, 07:22 PM
  4. Replies: 0
    Last Post: 12-13-2011, 05:13 PM
  5. Replies: 5
    Last Post: 11-08-2011, 05:18 PM
  6. Replies: 1
    Last Post: 07-15-2011, 01:24 AM
  7. Formula works only when I paste special and select values
    By mrcois in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-23-2010, 09:22 AM

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