PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Opening Excel Workbook while open in *obj/excel  (Read 987 times)

James Zukowski

  • Diamond Member
  • *****
  • Posts: 297
    • View Profile
Opening Excel Workbook while open in *obj/excel
« 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.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Susan Cryderman

  • Staff
  • Gold Member
  • *****
  • Posts: 63
    • View Profile
    • PVX Plus Technologies Ltd.
Re: Opening Excel Workbook while open in *obj/excel
« Reply #1 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.

 

James Zukowski

  • Diamond Member
  • *****
  • Posts: 297
    • View Profile
Re: Opening Excel Workbook while open in *obj/excel
« Reply #2 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.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services