Quantcast
Channel: Instantiating an Excel Object from Peoplesoft page
Viewing all 62 articles
Browse latest View live

(no title)

$
0
0

We recently upgraded tools from 8.49.19 to 8.49.33. The app engine is showing exact same error as above.

First operand of . is NULL, so cannot access member DisplayAlerts. (180,236) RCL_PND_ITEM.MAIN.GBL.default.1900-01-01.Step01.OnExecute PCPC:284 Statement:3

Process 6914478 ABENDED at Step RCL_PND_ITEM.MAIN.Step01 (PeopleCode) — RC = 8 (108,524)

Is that because of tools version. Help will be appreciated


(no title)

$
0
0

Possibly, might be worth checking out Oracle Support for the error.

(no title)

$
0
0

Additional information to above is, earlier server had Excel 2003 and after upgrade, it is Excel 2008

(no title)

$
0
0

Has anybody seen any type of on-line documentation that covers standard Excel COM object references within PeopleCode?
I'm looking for something that provides me with a mapping on how to reference code created using VBA in to PeopleCode.

My current challenge is how to apply a theme to an Excel Spreadsheet using the following VBA.

Any tips would be greatly apprecaited.

ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$H$30"), , xlYes).Name = "Table2"
Range("Table2[#All]").Select
ActiveSheet.ListObjects("Table2").TableStyle = "TableStyleMedium9"

Thanks…

Tom

(no title)

$
0
0

Hi,

We have an application engine which populates the data from the output of a SQR to an excel template saved in the process scheduler server. When the application engine gets initiated, it fails with no errors in the out file i.e. it simply produces a 0kb out file but on tracing we found that it gets stuck at the below piece of code and is not moving further.

5: &oWorkApp = CreateObject("COM", "Excel.Application");
6: &oWorkApp.DisplayAlerts = "True";
7: &oWorkBook = ObjectGetProperty(&oWorkApp, "Workbooks");
8: &oWorkBook.Open("path\excel_Template.xls");
At step 8 it fails. We have mocrosoft excel installed in the report server . Any quick suggestions will be helpful.

(no title)

$
0
0

Did you ever find any on-line documentation that covers standard Excel COM object references within PeopleCode? I'm trying to translate Excel VBA to PeopleCode.

(no title)

$
0
0

1. Set the properties with ObjectSetProperty( &oWorkApp, "DisplayAlerts ", True ) and see what that gets you.

2. If you have access to that server you can login and use the property ObjectSetProperty( &oWorkApp, "Visible", True ) and you might be able to see Excel open and view the error that is happening.

3. Also unless you are using close() and/or exit() you may have many instances of Excel.exe running on that machine. You may need to go kill those processes so the machine isn't confused or overloaded.

I hope some of those suggestions help.

(no title)

$
0
0

I have an App engine peoplecode that reads a table and write in excel. If there is any reason the AE errors out, we have some instances of excel left open on the server. Is there a sureshot way of killing these excel instances or make sure they always close?

Following is the code:

PSHome = GetEnv("PS_HOME");

/* Set up the Excel COM objects and open the template file */
Local object &oWorkApp, &oWorkBook;
&oWorkApp = CreateObject("COM", "Excel.Application");
&oWorkApp.DisplayAlerts = "False";
&oWorkBook = ObjectGetProperty(&oWorkApp, "Workbooks");

REM LOCAL &oWorkBook.open("C:\temp\template.xlsx");
&TemplateFileName = &PSHome | "\….\….\ReportTemplate.xlsx";
&oWorkBook.open(&TemplateFileName);

&oWorkSheet = &oWorkApp.Worksheets("Sheet1");

&ReportFile = %FilePath | "EEReport.xlsx";
&oWorkApp.ActiveWorkBook.SaveAs(&ReportFile);

/* Begin writing the worksheet data */
&Row = 1;
&Col = 1;
If N_EE_RPT_AET.N_PROFILE_TYPE = "S" Then
&Title = Profile Data";
Else
&Title = "Review Data";
End-If;

&oWorkSheet.Cells(&Row, &Col).Value = &Title;
&oWorkSheet.Cells(&Row, &Col).Font.Bold = True;

&EEReport = CreateRecord(Record.N_EE_REPORT);
&EEReportSel = CreateSQL("%SelectAll(:1) WHERE PROCESS_INSTANCE = :2 ORDER BY EMPLID, SEQNBR");
&EEReportSel.Execute(&EEReport, N_EE_RPT_AET.PROCESS_INSTANCE);

&Row = 2;

/* Col A */
&Col = 1;
&oWorkSheet.Cells(&Row, &Col).Value = "Emplid";

/* Col B */
&Col = &Col + 1;
&oWorkSheet.Cells(&Row, &Col).Value = "Employee Name";
…..
…..
…..
…..

While &EEReportSel.Fetch(&EEReport);
&Col = 0;

&Row = &Row + 1;
&Col = &Col + 1;
&oWorkSheet.Cells(&Row, &Col).Value = &EEReport.EMPLID.value;

&Col = &Col + 1;
&oWorkSheet.Cells(&Row, &Col).Value = &EEReport.EMPL_NAME.value;

…..
…..
…..
…..

End-While;

/* Save Excel file and quit */
&oWorkApp.ActiveWorkBook.Save();
&oWorkApp.ActiveWorkBook.Close();
&oWorkApp.DisplayAlerts = "True";
&oWorkBook.Close();
&oWorkApp.Quit();


Issues Instantiating Excel from PeopleCode

$
0
0

In addition to the previously mentioned solutions:

1) Excel Not Installed proper server… AppServer (Online PeopleCode) or ProcSched (Batch / AppEngine PeopleCode)
2) Wrong version of Excel (64 bit vs 32 bit)

We found a 3rd issue

3) Tuxedo and Oracle Proc Mgr services started with VM user ID instead of local system user ID (PS Admin / Infrastructure issue).

Hope this helps.

(no title)

$
0
0

Can you read an .xlsx file using this application? If so, what would the code look like? Thank you.

(no title)

$
0
0

Hi. Is there anyway to change the worksheet's name?
I tried the following but got error:

&oWorkSheet.Name = "test";

OLE Automation error in Excel.Application.Worksheets: ObjectDoMethod: Bad index. (180,161)

Thanks and regards.

Instantiating an Excel Object from Peoplesoft page

$
0
0

Using the example from PeopleBooks returns an error on the ObjectGetProperty statement and I don't know what is wrong with it.
The code used is as follows:

Local object &WorkApp, &WorkBook;

&WorkApp = CreateObject ("COM", "Excel.Application");
&WorkBook = ObjectGetProperty(&WorkApp, "Workbooks");

etc
The message returned for the ObjectGetProperty statement says "Invalid parameter: CreateObject Excel.Application invalid class string for function ObjectGetProperty. The specified parameter is not correct for the function. It may be the wrong type of parameter (string, number, record, field etc) or an invalid value in this context.

Can anyone help?

Re: Instantiating an Excel Object from Peoplesoft page

$
0
0

Should the variable &WorkBook be delcared as an object? If you change the delcaration line to:

 Local object &WorkApp; 

And remove, &WorkBook, does that make any difference?

Manipulating Excel Object in PeopleCode

$
0
0

Hi,

I have instantiated Excel Object in AE Peoplecode and have been successfully manipulating data cells in each worksheet tab of my workbook.
Now I want to copy a range of cells from one worksheet to another and paste its values on the other worksheet, though I dont encounter error but the
action does not execute. Also when I try to save the excel file it takes forever to save. Heres some part of my code
Appreciate your input.

get a cell range then;

&RangeSelected = &oCells.Copy;
&oWorkSheet1 = &oWorkApp.Worksheets("Sheet2");
&oCell = ObjectGetProperty(&oWorkSheet1, "Range", "A1");
&SheetSelected = &oWorkSheet1.Activate;
&oCell = ObjectGetProperty(&oCell, "PasteSpecial");

ObjectDoMethod(&WORKAPP, "Save", "C:\TEMP\TEST1.XLS");

Thanks a lot

Valkyrie

Re: Instantiating an Excel Object from Peoplesoft page

$
0
0

Hi Susan, I use the same code and it works fine. Only thing I notice in your code is that you have space between createObject and the parenthesis

Heres our code compare side by side
&WorkApp = CreateObject ("COM", "Excel.Application"); your code
&oWorkApp = CreateObject("COM", "Excel.Application"); my code

&oWorkBook = ObjectGetProperty(&oWorkApp, "Workbooks"); my coode
&WorkBook = ObjectGetProperty(&WorkApp, "Workbooks"); your code

I hope it helps..

Valkyrie


Re: Instantiating an Excel Object from Peoplesoft page

$
0
0

Yes its should be declare as Object when instantiating workbook, worksheet, range or cell objects in Excel heres my declaration and it works fine;

Local object &oWorkApp, &oWorkSheet, &oWorkBook, &oRange, &oCells;

Valkyrie

Re: Manipulating Excel Object in PeopleCode

$
0
0

Hi - I have sqr process to read the .dat file as input file. But I am getting the file in excel format. I want to convert this XLS file into .dat format. I am unable to do this through the SQR. One of my colleague suggest me go with the Application Engine. Here is the code I am trying to convert the XLS file into .DAT through the App Engine. But I am missing the link between after opening the xls file and writing into .DAT file. Can you help me how to connect between after opening the file and writing the file.

&oWorkApp = CreateObject("COM", "Excel.Application");
ObjectSetProperty(&oWorkApp, "Visible", True);
&oWorkBook = ObjectGetProperty(&oWorkApp, "Workbooks");
&oWorkBook.Open("C:\temp\rates99.xls");

Local File &DATFILE;
Local string &FILE_NAME, &DATA;

&FILE_NAME = "C:\temp\rates.dat";
&DATFILE = GetFile(&FILE_NAME, "r");
&FileName = &DATFILE.Name;
&POS = Find(".", &FileName);
&NEWFILE_NAME = Substring(&FileName, 1, &POS) | "dat";
&DATFILE = GetFile(&NEWFILE_NAME, "N", %FilePath_Absolute);
If &DATFILE.IsOpen Then
While &DATFILE.ReadLine(&DATA);
&DATFILE.WriteLine(&DATA);
End-While;
&DATFILE.Close();
End-If;

Re: Instantiating an Excel Object from Peoplesoft page

$
0
0

Hello Susan,

Are you still having the same error "Invalid parameter: CreateObject Excel.Application invalid class string for function ObjectGetProperty." ? What have you done to correct this error?
I am actually facing the same error when using the following code in my AE peoplecode:
Local object &oWorkApp,&oWorkBook;
&oWorkApp = CreateObject("COM", "Excel.Application");
&oWorkBook = ObjectGetProperty(&oWorkApp, "Workbooks");

Thank you for your help.

Re: Manipulating Excel Object in PeopleCode

(no title)

$
0
0

Hi,

I want to use this piece of code on my page on the hyperlink.

Local object &oWorkApp, &oWorkBook;
&oWorkApp = CreateObject("COM", "Excel.Application");
&oWorkApp.DisplayAlerts = "False";
&oWorkBook = ObjectGetProperty(&oWorkApp, "Workbooks");
&oWorkBook.Open("C:\some_path_to\template.xls");
&oWorkSheet = &oWorkApp.Worksheets("Sheet1");
&oWorkApp.ActiveWorkBook.SaveAs("C:\your_output_file.xls");

But when I click on the link it gives me the error 'Class COM not found. The given class is not found in the database or having problems to access it.'

Please help.

Viewing all 62 articles
Browse latest View live