cancel
Showing results for 
Search instead for 
Did you mean: 

"Automation error" when run VBA EPM RunPackage

patrice_chartier
Explorer
0 Kudos
324

Could someone help to fix my error in VBA.

I try to execute this code and got the error "automation error"....Thanks

=============================================

Sub test()

Dim pkge As New FPMXLClient.ADMPackage

Dim EPM As New FPMXLClient.EPMAddInDMAutomation

With pkge

.GroupId = "Data Management"

.TeamId = "BPC_CC"

.Filename = "/CPMB/CLEAR"

.PackageId = "Clear"

.PackageType = "Process Chain"

.PackageDesc = ""

.UserGroup = ""

End With

EPM.RunPackage pkge, "C:\Temp\DMUserSelection4.xml"

End Sub

===================================================

Here's my XML file

======

Clear{param_separator}<?xml version="1.0" encoding="utf-16"?> <ArrayOfAnswerPromptPersistingFormat xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <AnswerPromptPersistingFormat>

<_ap>

<Name>%SELECTION%</Name>

<Values />

</_ap>

<_apc>

<StringListPair> <str>CATEGORY</str> <lst> <string>ACTUAL_FMO</string> </lst> </StringListPair>

</_apc>

</AnswerPromptPersistingFormat>

</ArrayOfAnswerPromptPersistingFormat>

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member186338
Active Contributor
0 Kudos

Using the code from my blog you have to:

Public Sub TestRunDM()
    Dim strAnsw() As String
    ' Sample to run Clear DM package    
    ReDim strAnsw(0 To 3)
    strAnsw(0) = "%SELECTION%P|DIMENSION:CATEGORY|ACTUAL_FMO"
    strAnsw(1) = "%SELECTION_KEYDATE%V-1"
    strAnsw(2) = "%ENABLETASK%V1"
    strAnsw(3) = "%CHECKLCK%V0"
    ExeceuteDM strAnsw, "BPC_CC", "Data Management", "Clear", "/CPMB/CLEAR", "0001"
End Sub
former_member186338
Active Contributor
0 Kudos

P.S. Are you sure that you have Clear package in BPC_CC team folder - in the Data Management subfolder?

patrice_chartier
Explorer
0 Kudos

I found the error, I was missing this part in my code:

.UserGroup = "0001"

Now it works....thanks

former_member186338
Active Contributor
0 Kudos

Then close the question accepting the correct answer.

patrice_chartier
Explorer
0 Kudos

Last question...do you know how to start a Package-Link ?

former_member186338
Active Contributor
0 Kudos

There is no way to start Package-Link the same way (passing answer prompt).

patrice_chartier
Explorer
0 Kudos

Yes I saw your blog. This is from where I started but I still have this "Automation Error". I wrote my code and built the XML file based on your blog. But maybe I mist something. You can see my code and XML above.

former_member186338
Active Contributor
0 Kudos

In your code you are using not all variables required to run standard Clear package!

former_member186338
Active Contributor
0 Kudos