Hi,
I need to create more than one sheet on excel, anyone can help me?
Hi,
I need to create more than one sheet on excel, anyone can help me?
I am facing the same issue. Can you please guide me what was done to fix this issue? for the below metioned code I m getting the following error when the AE program is run in 2 tier mode:
try
&oWorkApp = CreateObject("COM", "Excel.Application");
&oWorkApp.DisplayAlerts = "False";
&oWorkBook = ObjectGetProperty(&oWorkApp, "Workbooks");
&oWorkBook.Open("C:\temp\template.xls");
&oWorkSheet = &oWorkApp.Worksheets("Sheet1");
&oWorkApp.ActiveWorkBook.SaveAs("C:\temp\your_output_file.xls");
/* then go crazy with your worksheet object */
/* eg */
&oWorkSheet.Cells(1, 1).Value = "I'm adding stuff to be bolded";
&oWorkSheet.Cells(1, 1).Font.Bold = True;
/* Save Excel file and quit */
&oWorkApp.ActiveWorkBook.Save();
&oWorkApp.ActiveWorkBook.Close();
&oWorkApp.DisplayAlerts = "True";
&oWorkApp.Quit();
catch Exception &c1
MessageBox(0, "", 0, 0, "Caught exception: " | &c1.ToString());
end-try;
ERROR RECEIVED -
Caught exception: First operand of . is NULL, so cannot access member DisplayAlerts. (180,236)
Looks like the &oWorkApp object is not being instantiated properly, has that object been declared in your code?
I tried your code, and it works fine for me - for some reason it isn't picking up the Excel.Application COM object. Which version of PeopleTools are you on?
When i executing Appengine i got following error
First operand of . is NULL, so cannot access member DispalyAlerts. (180,236) DS_PC_APP.MAIN.GBL.default.1900-01-01.Step02.OnExecute PCPC:188 Statement:2
Message Set Number: 180
Message Number: 236
Message Reason: First operand of . is NULL, so cannot access member %1. (180,236)
Process 1549 ABENDED at Step DS_PC_APP.MAIN.Step02 (PeopleCode) — RC = 8 (108,524)
Message Set Number: 108
Message Number: 524
Message Reason: Process 1549 ABENDED at Step DS_PC_APP.MAIN.Step02 (PeopleCode) — RC = 8 (108,524)
Process %s ABENDED at Step %s.%s.%s (Action %s) — RC = %s
As per other posts, looks like the following line:
&oWorkApp = CreateObject("COM", "Excel.Application");
Is not working, which PeopleTools version are you running?
may be you don't have microsoft excel installed on your server that running this app engine. i got the same error, before i install the ms excel in my server. CMIIW ^^
Hi,
The pre/requisite to use Excel API class is are:
1) Should be run in a windows env. Hence the batch server should be windows, in Unix these commands will not work
2) MS Excel should be installed in the windows machine. If not, then calling createobject for Excel application will throw exceptions since there is no underlying excel libraries to handle the call.
To test your AE works or not, you can try running AE in 2 tier i.e directly from Application designer assuming your work env machine is windows with excel installed. The code should work properly there.
Thanks for those tips.
Thanks in advance
anybody please reply to my requirements-—
1)i am giving user to upload a xls file
2)then i want to populate xl file data in grid
please advice me…….
Hi Dave,
Just wondering if you managed to get this working and if so, share any tips on how to do it?
Praj
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
Possibly, might be worth checking out Oracle Support for the error.
Additional information to above is, earlier server had Excel 2003 and after upgrade, it is Excel 2008
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
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.
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.
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.
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();
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.