+ Reply to Thread
Results 1 to 24 of 24

.Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

  1. #1
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Hi everybody

    I'm trying to copy a range from a worksheet, and paste it "Linked to the source".
    I have a Power Point file with 2 blank slides named Test.pptx

    The partial code I post here copies a first range and pastes it by default conditions, and goes OK
    the second range, I try to paste and link to the source, but I only get error
    I've tried diferent options I found over the web, but no one works.

    It must be something simple I'm mistaking.


    Please Login or Register  to view this content.
    Your help will be very appreciated
    Last edited by vichopalacios; 12-12-2016 at 05:37 PM.
    Barriers are there for those who don't want to dream

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Are you sure your code fails where you say?

    This runs:
    Please Login or Register  to view this content.
    But this does not:
    Please Login or Register  to view this content.
    Perhaps amend the last line to:
    either
    Please Login or Register  to view this content.
    OR
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Hi Kev

    Thank you for taking the time...
    Are you sure your code fails where you say?
    Yes, I'm pretty sure, and you can see here in the image:

    As I said in the original post, the first range fron Hoja1 is copied and pasted to Slide1 correctly.
    So I don't need to change anything in this part, as it is not intended to be linked.
    Then the range from Hoja2 is copied and it actually gets pasted, but the code goes on error and stops.
    If I clear the error manually, the table IS in the ppt, and IS LINKED,
    my problem is to understand where the error comes from, and how to solve it.

  4. #4
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Sorry, I'm having some problems uploading the image attachment
    I hope here it goes now
    if not, I'll try later to upload it

  5. #5
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Sorry, I'm having some problems uploading the image attachment
    I hope here it goes now
    if not, I'll try later to upload it

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    There should be an error number and description - what are they?

    Put this in your code
    the line before VBA crash
    Please Login or Register  to view this content.
    on line after VBA crash
    Please Login or Register  to view this content.
    What's does the message box say?

    The above code (without MsgBox Err.Number & vbCr & Err.Description) should keep your VBA working and the macro should finish normally

  7. #7
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Hi Kev

    The error shown is ( my system is in spanish):
    Se ha producido el error '424' en tiempo de ejecución:
    Se requiere un objeto
    which translated into english means something like "an object is required".
    When I put the message box, is the same 424 error, object required

    And YES, of course I used the
    Please Login or Register  to view this content.
    to avoid the problem, but i was wondering where it comes from.

    This little piece of code, actually belongs to a larger and more complex process, so I do prefer to SOLVE the errors, rather than COVER or HIDE them.
    Again, thank a lot for your time, if you wish, keep with me trying to decipher the mistake.
    I'll keep looking for a solution.

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Try this code on its own and let's see what happens. Let me know

    Please Login or Register  to view this content.

  9. #9
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Compile error:
    Sintaxis error in
    Please Login or Register  to view this content.
    I went over this before, and tried using the possibilities that intelisense gives,
    .aply
    .select
    there is no .paste
    but no help at all

  10. #10
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Sorry! Somehow I dropped off the .select - oops!!

    Please run this amended code on its own
    - will prove whether the problem is with this bit of code or elsewhere

    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    I also used
    Please Login or Register  to view this content.
    and some other variations working with the help of intelisense
    no one solved.
    this particular one did the same as the original
    Please Login or Register  to view this content.
    and again, went into the same error

  12. #12
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    we posted at same time!
    I want you try my short code
    see post#10

  13. #13
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    I've been fighting with this for a few days, and all the tests tell me that the problem is in the
    Please Login or Register  to view this content.
    when trying to link to the source.

  14. #14
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    yes
    I saw and tested post 10
    the same exact error

  15. #15
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    when I put the same sintaxis but with false
    Please Login or Register  to view this content.
    there is no error

  16. #16
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Hi,

    Do you still have the error with this
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  17. #17
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Can you try without VBA
    Have workbook and presentation files open

    Go into workbook and select Sheets("Hoja2").Range("B6:E15")
    then {CTRL} + c (to copy)
    Then select presentation, click on slide(2)
    then on Home tab:
    click "down arrow" on Paste
    + PasteSpecial
    + PasteLink
    + OK

    Does it allow you to do that?
    Can you now go into the worksheet and amend the values and see them change in the slide?

    PP PasteSpecial Link.jpg
    Last edited by kev_; 12-13-2016 at 01:28 PM.

  18. #18
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Kev
    Yes, As I said in the beginning it works manually.

    xlnitwit ::::: YEAH !
    It works !

    I still cannot deal why, but it works
    the only real difference, as I can see is .Item(1)
    Do you have an idea of why ?

  19. #19
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Well done @xlnitwit!

  20. #20
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    I admit I do not know why the original fails but it is unnecessary to select the shape so it seemed expedient to avoid it.

  21. #21
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    The mistery of MSOExcel !!
    Thanks a lot xlnitwit

  22. #22
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    The mistery of MSOExcel !!
    And thanks Kev, too

    If you guys, find a real explanation, please share with us
    Last edited by vichopalacios; 12-14-2016 at 03:03 AM.

  23. #23
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    Agreed
    - your original code works on my PC - where is the logic in that!!

  24. #24
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: .Shapes.PasteSpecial(Link:=True) from Excel Range to ppt fails

    After all the research I've been doing, and considering my very short experience with VBA in Power Point, I shuold say the error depends on the PP version, and has nothing to do with Excel.
    There are a lot of codes around the web, using that line, and almost nobody report that problem.
    Anyhow, thanks for your time.....have a nice day

    Vicho

+ 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. Run-time error on shapes.visible=true macro
    By djagxk8 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-02-2016, 03:27 PM
  2. Workbooks.Open (Readonly:= true) fails at random times
    By wannabeNerd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-30-2015, 03:53 AM
  3. [SOLVED] ws.Paste method fails after lots of copy-paste of shapes
    By bagullo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-15-2015, 03:00 AM
  4. [SOLVED] Condensing ActiveSheet.Shapes().Visible=True
    By eculver in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-15-2013, 07:52 PM
  5. REQUEST: Macro to Link Excel Cell to Shapes
    By MBCMDR in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-29-2011, 05:21 AM
  6. [SOLVED] PasteSpecial of range class failed in Excel 2003
    By Sachin Vaishnav in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2006, 02:35 AM
  7. Shapes.visible = false/true
    By Ctech in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2006, 10:30 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