Hi All,
My Requirement is to Read to a Excel file Through Job .I am Facing this issue while running.I need to Read the excel file and display in info.I have written my code for your reference.Please Help Me to fix this.Thanks in Advance.Experts send some Tested code.
issue: Method 'item' in COM object of class 'Workbooks' returned error code 0x8002000B (<unknown>) which means: <unknown>.
x++ code:
static void veeraExcel(Args _args)
{
SysExcelApplication application;
SysExcelWorkbooks workbooks;
SysExcelWorkbook workbook;
SysExcelWorksheets worksheets;
SysExcelWorksheet worksheet;
SysExcelCells cells;
COMVariantType type;
int row;
ItemId itemid;
InventDim inventdim;
InventSiteId inventsiteid;
InventItemInventSetup inventsetup;
Name name;
FileName filename;
;
application = SysExcelApplication::construct();
workbooks = application.workbooks();
//specify the file path that you want to read
filename ="C:\\item.xls";
workbook = workbooks.item(1);
worksheets = workbook.worksheets();
worksheet = worksheets.itemFromNum(1);
cells = worksheet.cells();
do
{
row++;
itemId = cells.item(row, 1).value().bStr();
inventsiteid = cells.item(row, 2).value().bStr();
inventsetup.LowestQty= cells.item(row, 3).value().int();
inventsetup.HighestQty=cells.item(row, 4).value().int();
//editHighestQty= cells.item(row, 3).value().bStr();
info(strfmt('%1 - %2- %3- %4', itemId, inventsiteid,inventsetup.LowestQty,inventsetup.HighestQty));
type = cells.item(row+1, 1).value().variantType();
}
while (type != COMVariantType::VT_EMPTY);
application.quit();
}
*This post is locked for comments