PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: James Zukowski on November 17, 2021, 09:54:51 AM

Title: Opening Excel Workbook while open in *obj/excel
Post by: James Zukowski on November 17, 2021, 09:54:51 AM
Is there a way to open an Excel workbook on a file channel while it's being processed with *obj/excel? I get an Error #12 even if the workbook is being accessed via 'OpenWorkbook().
Conversely, if I open the workbook as a file first, I can still get to it through *obj/excel. Which is OK, if the workbook already exists. But if I need to 'CreateWorkbook(), there's a bit of a problem.
This doesn't seem to be a problem if the workbook is opened directly in Excel.
Title: Re: Opening Excel Workbook while open in *obj/excel
Post by: Susan Cryderman on November 17, 2021, 11:36:48 AM
James,

I'm not sure I understand the issue.  If I open an existing Excel workbook using the OpenWorkbook method in the *obj/excel.pvc object and then try to open it directly in PxPlus with an OPEN command - I get an error 0 message - the same as I would get if I try to open it on PxPlus while it is opened in Excel itself.

 
Title: Re: Opening Excel Workbook while open in *obj/excel
Post by: James Zukowski on November 18, 2021, 12:16:44 PM
Part of our output selection routine now includes XLSX. The routine required access to a file, and I was trying to link the actual Workbook file to the channel. To make things easier all around, the Workbook is opened through the object, and the channel# is pacified with /dev/null.