Pasting from VBA causes Macro Security warning

S

Sean McPoland

Wonder if anyone can help

Code at end:

Basically I have a Powerpoint presentation with some VBA
to pull charts from Excel. The PPT VBA opens the file
runs the Excel Macro and then selects charts and adds then
to the PPT presentation, bog standard stuff, except when
doing the paste into the running PPT presentation slide it
says:

Security Warning:
The Document you are opening contains
macros...disable/enable etc

This happens specifically on the
ActiveWindow.View.Paste statement.

First thing is I know the excel sheet has macros - I just
ran it, with no problems, and I know the PPT has macros -
I am running it at this time! Why would paste try to open
the currently open document and ask this dumb question?

Win 2003 Sever, Office 2003 Pro

Thanks in advance
regards
Sean


Sub Macro1()

On Error Resume Next
Dim appXL As Excel.Application
Set appXL = New Excel.Application
appXL.Visible = True

appXL.Workbooks.Open "D:\xxx.xls"
appXL.Run ("sDriver")

appXL.Sheets("Chart1").Select
appXL.ActiveChart.ChartArea.Select
appXL.ActiveChart.ChartArea.Copy
ActivePresentation.Slides.Add(Index:=1,
Layout:=ppLayoutTitle).Select
ActiveWindow.Selection.SlideRange.Layout =
ppLayoutBlank
ActiveWindow.View.Paste
....

End Sub
 
S

Shyam Pillai

Sean,
Create a self certificate and sign your Excel spreadsheet. That will take
care of it.
 
A

Albert Herremans

I have the same problem with an EXE file I created myself (a slideshow) and
which I am calling from PowerPoint 2000

do I do something similar to what you are suggesting to Sean? or something
else? using the lowest security level does not help!

Albert
 
S

Steve Rindsberg

I have the same problem with an EXE file I created myself (a slideshow) and
which I am calling from PowerPoint 2000

do I do something similar to what you are suggesting to Sean? or something
else? using the lowest security level does not help!

Ni hao Albert ;-)

Try using a Run Program action setting instead of linking to the EXE file.
That fires off EXEs w/o a complaint under PPT2000.

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
A

Albert Herremans

Ni hao, Steve!

as you see, I am back again, as every year when preparing my end of year
courses for the Senior students...

I moved to PPT2000 altoygh I cannot use it in the classroom, always equiped
with PPT97; but just for me, not to say too far behind...

so, I might need more help in the next weeks...

I'll try this one and be back

thank you

Albert
 
S

Steve Rindsberg

Ni hao, Steve!

as you see, I am back again, as every year when preparing my end of year
courses for the Senior students...

I moved to PPT2000 altoygh I cannot use it in the classroom, always equiped
with PPT97; but just for me, not to say too far behind...

so, I might need more help in the next weeks...

You know where to find us. Good luck!

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 

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