Excel crashes when copying cell contents to PowerPoint

B

Brian Harvey

Hello everybody,

As the subject line says, Excel crashes after it copies cell contents
to Powerpoint. The PowerPoint presentation is produced without a
hitch, but as soon as I try to do anything in Excel, I get the
following EXCEL.EXE application error: The instruction at "0x206019f5"
referenced memory at "0x000000dc". The memory could not be "read".

Here is the code I'm executing:

Dim ppt As Object
Dim pres As Object

'Create a Microsoft PowerPoint session
Set ppt = CreateObject("powerpoint.application")

'Copy the chart on the Chart Labels Demo sheet
Range("A1:J3,A16:J18,A31:J33,A46:J48,A61:J63,A76:J78").Select
Range("A76").Activate
Selection.Copy

'Create a new document in Microsoft PowerPoint
Set pres = ppt.Presentations.Add

'Add a slide
pres.slides.Add 1, ppLayoutBlank

'Make PowerPoint visible
ppt.Visible = True

'Activate PowerPoint
AppActivate ppt.Name

'Paste the chart
ppt.ActiveWindow.View.Paste

Application.CutCopyMode = False

Set ppt = Nothing

Am I filling up the memory? If so, how can I clear it once the
PowerPoint presentation has been created?

Thanks in advance for your help.
Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top