Advertisement

09.16.2008 at 11:47AM PDT, ID: 23736214 | Points: 500
[x]
Attachment Details

Import Powerplay into Excel

Asked by kb1esx in VB Script, Microsoft Excel Spreadsheet Software, Cognos PowerPlay

Tags: , ,

Hi,

I'm trying to write some code that will import several PowerPlay reports into individual tabs in Excel.

I found the attached code but it doesn't seem to function.  I get an error of: The system cannot find the file specified.

Any suggestions?

Thanks.

DavidStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
Sub ImportPowerPlay()
Dim PowerPlayReport, PowerPlay As Object
Dim ReportName, WorkBookName, OpenDir, SaveDir As String
Dim ReportPath, WorkBookPath As String
 
OpenDir = "D:\"
SaveDir = "D:\"
ReportName = "PPlay1.ppr"
WorkBookName = "PPlay1.xls"
ReportPath = OpenDir & ReportName
WorkBookPath = SaveDir & WorkBookName
 
Set PowerPlayReport = GetObject(ReportPath)
Set PowerPlay = PowerPlayReport.Application
 
'Remove the following line, if desired
'--------------------------------------
PowerPlayReport.Visible = True
PowerPlayReport.SaveAs WorkBookPath, 4, True
PowerPlayReport.Close
PowerPlay.Quit
Set PowerPlayReport = Nothing
Set PowerPlay = Nothing
Workbooks.Open WorkBookPath
End Sub
[+][-]09.17.2008 at 01:17AM PDT, ID: 22496494

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.17.2008 at 05:54AM PDT, ID: 22497876

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.17.2008 at 11:32PM PDT, ID: 22508260

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.18.2008 at 05:51AM PDT, ID: 22510269

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628