Pinlop
Pinlop

Reputation: 245

Run-time error '438'

I'm aware that there are several posts regarding this Run-time error '438', but I still can't figure out how to fix this. This is my entire code: https://pastebin.com/S6LigcWz but the part in question is this:

With c.ChartData
    .Activate
    .Workbooks.Sheets(1).UsedRange.Clear
    .Workbooks.Sheets(1).Range(A2).Select
    .Selection.PasteSpecial xlPasteValues
    .Workbooks.Close
End With                

This code starts in ppt then goes into excel and copies a range then "tries" to paste into a chart in ppt. This is the part of the code where it's trying to paste into the chart, and the part where the error occurs. It errors on .Workbooks.Sheets(1).UsedRange.Clear

Any help is appreciated.

Upvotes: 0

Views: 121

Answers (1)

DaBeau96
DaBeau96

Reputation: 548

I would take the dots off the beginning of the Workbooks because ChartData doesn't have a Workbooks member

Upvotes: 2

Related Questions