Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro anomoly (2003)

    I have to do a bit of faffing about copying charts from Excel to PP on a weekly basis, resize, & jump back to Excel for the mnext chart.

    So I created a simple macro but the sendkeys at the end (for alt+tab) doesn't funtion. Anyone know why not? Cheers.







    Code;

    Sub PasteSpecialChart()

    ' Selects all graphics on current page & replaces them
    ' with the graph on the clipboard
    ' then jumps back to Excel

    ActiveWindow.Selection.SlideRange.Shapes.SelectAll
    ActiveWindow.Selection.ShapeRange.Delete

    ActiveWindow.View.PasteSpecial ppPasteMetafilePicture, msoCTrue

    With ActiveWindow.Selection.ShapeRange
    .ScaleWidth 1.53, msoFalse, msoScaleFromMiddle
    .ScaleHeight 1.53, msoFalse, msoScaleFromMiddle
    End With

    SendKeys "%{tab}", True

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro anomoly (2003)

    SendKeys is not always dependable. Try this instead:

    AppActivate "Microsoft Excel"

Posting Permissions

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