T
technoknight
Hello,
I am into powerpoint Automation. Let me first describe what I m trying to
do. The expected behaviour is:
1) I open a powerpoint presentation.
2.) Run my Powerpoint Automation Application.
3) When I click a button "Save" on my custom application, it should add some
effects(using a function called addeffects) and save my powerpoint onto a
specified location i.e. c:\temp\savedppt.ppt (in my case).
When I trace my code in the debug mode my application saves the current ppt
with the name specified, opens the ppt, add effects, saves it and closes it.
I can see a file "avedppt.ppt" at c:\temp.
But, When I implement my code as dll, it will not save the powerpoint file.
Rather it will go to the error handler in my code.
My functions to do all these steps is as follow:
************************************************************
Public Function Pack(FileLocation As String)
On Error GoTo err_handle:
Dim oPres
Dim FileName As String
If FileLocation <> "" Then
App_.ActivePresentation.SaveCopyAs(FileLocation)
TRACE "Presentation has been saved as:" & FileLocation
Set oPres = App_.Presentations.Open(FileLocation, , False)
TRACE "Presentation opened for Adding effects"
AddEffects 'my effects adding function which runs fine
TRACE "Effects added"
oPres.Save
TRACE "Presentation saved with effects"
oPres.Close
TRACE "Packed presentation closed"\
End If
Exit Function
err_handle:
TRACE "The function to add effects was called but it failed.The filename
was" & FileLocation, "False"
TRACE Err.Description, "False"
End Function
**********************************************************
Can someone please tell me why my code is not working fine when I implement
it as dll, although its running fine in the trace mode?
Thanks.
I am into powerpoint Automation. Let me first describe what I m trying to
do. The expected behaviour is:
1) I open a powerpoint presentation.
2.) Run my Powerpoint Automation Application.
3) When I click a button "Save" on my custom application, it should add some
effects(using a function called addeffects) and save my powerpoint onto a
specified location i.e. c:\temp\savedppt.ppt (in my case).
When I trace my code in the debug mode my application saves the current ppt
with the name specified, opens the ppt, add effects, saves it and closes it.
I can see a file "avedppt.ppt" at c:\temp.
But, When I implement my code as dll, it will not save the powerpoint file.
Rather it will go to the error handler in my code.
My functions to do all these steps is as follow:
************************************************************
Public Function Pack(FileLocation As String)
On Error GoTo err_handle:
Dim oPres
Dim FileName As String
If FileLocation <> "" Then
App_.ActivePresentation.SaveCopyAs(FileLocation)
TRACE "Presentation has been saved as:" & FileLocation
Set oPres = App_.Presentations.Open(FileLocation, , False)
TRACE "Presentation opened for Adding effects"
AddEffects 'my effects adding function which runs fine
TRACE "Effects added"
oPres.Save
TRACE "Presentation saved with effects"
oPres.Close
TRACE "Packed presentation closed"\
End If
Exit Function
err_handle:
TRACE "The function to add effects was called but it failed.The filename
was" & FileLocation, "False"
TRACE Err.Description, "False"
End Function
**********************************************************
Can someone please tell me why my code is not working fine when I implement
it as dll, although its running fine in the trace mode?
Thanks.