PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Create/Update Excel Workbook  (Read 2214 times)

Tom Anderson

  • Silver Member
  • ***
  • Posts: 26
    • View Profile
Re: Create/Update Excel Workbook
« Reply #15 on: June 08, 2023, 05:37:52 PM »
Also,

I tried the program on customer's system today and got the same results (v16)

James Zukowski

  • Diamond Member
  • *****
  • Posts: 296
    • View Profile
Re: Create/Update Excel Workbook
« Reply #16 on: June 09, 2023, 08:43:03 AM »
Tom:
Try printing HTA(x_obj'sep$) to see what's actually there.
Also, what server/client operating systems are you running? WindX? nthost/ntslave? Simple CS? These might help point to the problem.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Tom Anderson

  • Silver Member
  • ***
  • Posts: 26
    • View Profile
Re: Create/Update Excel Workbook
« Reply #17 on: June 09, 2023, 09:19:35 AM »
James,

hta(x_obj'sep$) = 8A

Windows Server 2019. Using Windx running on Windows 7, 10 and 11. Tried them all. Same result. Latest Excel version and also tried Excel 2016.


Tom Anderson

  • Silver Member
  • ***
  • Posts: 26
    • View Profile
Re: Create/Update Excel Workbook
« Reply #18 on: June 09, 2023, 10:26:08 AM »
Update - downloaded and installed demo version of version 20 and the program now works as expected.

I am wondering if I have the latest version of 16 installed. When I look on the website it shows 16.2 in the downloads section.

How can I determine exactly what version I have installed?

Thanks!


James Zukowski

  • Diamond Member
  • *****
  • Posts: 296
    • View Profile
Re: Create/Update Excel Workbook
« Reply #19 on: June 09, 2023, 11:05:31 AM »
From command mode, print SSN
The first 4 digits are the version number; 2 digits major, 2 digits minor
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: Create/Update Excel Workbook
« Reply #20 on: June 09, 2023, 11:09:26 AM »
Tom,

You can print TCB(29) to see what version is installed.  Version 16 should show 16000000 and 16.2 should show 16200000.

Just to clarify - were you still using WindX when it worked using verison 20?

Thanks,

Susan Cryderman

  • Staff
  • Gold Member
  • *****
  • Posts: 63
    • View Profile
    • PVX Plus Technologies Ltd.
Re: Create/Update Excel Workbook
« Reply #21 on: June 09, 2023, 11:59:36 AM »
Tom,

It appears that writing the data using WindX may be the issue.  Please open a support ticket and be sure to provide the version and serial number.


Tom Anderson

  • Silver Member
  • ***
  • Posts: 26
    • View Profile
Re: Create/Update Excel Workbook
« Reply #22 on: June 09, 2023, 01:22:44 PM »
Susan,

I was not using Windx with version 20.

I checked and have version 1600 installed.

I will open a support ticket per your suggestion.

Tom

Tom Anderson

  • Silver Member
  • ***
  • Posts: 26
    • View Profile
Re: Create/Update Excel Workbook
« Reply #23 on: June 20, 2023, 02:30:06 PM »
Issue finally resolved on creating Excel spreadsheet.

One other question - my customer uses a number of thin clients in the plant for production entry. All these clients have installed is the Windx client to run the PXPlus software.

It appears you cannot create an Excel spreadsheet from any of these machines do to the fact that Excel is not installed on them.

Is there a way to create and update a spreadsheet without having Excel installed?

Thanks!

Tom

Susan Cryderman

  • Staff
  • Gold Member
  • *****
  • Posts: 63
    • View Profile
    • PVX Plus Technologies Ltd.
Re: Create/Update Excel Workbook
« Reply #24 on: June 20, 2023, 03:03:22 PM »
Tom,

The PxPlus Excel object will look for Excel locally on the machine that instantiates the object (X_OBJ=new(*obj/excel).  If you run the program on a workstation, that workstation will need to have Excel installed.  If the program is run on the server - only the server should need to have Excel installed.  However, the excel file created would also be on the server.

There may be ways around this if you do not use the PxPlus Excel Object.

Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: Create/Update Excel Workbook
« Reply #25 on: June 20, 2023, 03:27:04 PM »
If you want to create a Excel spreadsheet without Excel you can use Google Sheets via a Google Sheets object to create the spreadsheet and export it as an .xlsx file.

The constructor requires a Client ID and Client Secret, both of which must be obtained from Google via the Google API Console. See Google API App Setup for detailed steps.

Example:

Code: [Select]
x=NEW("*obj/GoogleSheets",clientID$,clientSecret$)
!
! Wait for user to complete Google sign-in and allow PxPlus access
INPUT "Press any key to continue after logging into Google account and allowing PxPlus access:",*;PRINT ""
!
! Complete the Google Sheets login
x'Login()
!
! Open spreadsheet
path$="Commissions/JuneCommissions"
if x'CreateSpreadsheet(path$)=0 then MSGBOX "Couldn't find "+path$
!
...
! add things to the spreadhseet
...
!
! Export current spreadsheet as a XLSX
if x'ExportSpreadsheet("C:\Users\User\Documents\JuneCommissions.xlsx")=0 then MSGBOX "Couldn't export to xlsx"
!
! Close spreadsheets
if x'CloseSpreadsheets()=0 then MSGBOX "Couldn't close spreadsheets"
!
! Drop object
DROP OBJECT x
END
Principal Software Engineer for PVX Plus Technologies LTD.

Tom Anderson

  • Silver Member
  • ***
  • Posts: 26
    • View Profile
Re: Create/Update Excel Workbook
« Reply #26 on: June 20, 2023, 04:02:37 PM »
Devon,

Thanks for the suggestion. I'll look into it.

Off topic...there used to be a keystroke from a command prompt that would display all the current variable values on the screen.

For the life of me, I cannot remember what it was.

Can you help jog my memory.

Thanks!

Tom

James Zukowski

  • Diamond Member
  • *****
  • Posts: 296
    • View Profile
Re: Create/Update Excel Workbook
« Reply #27 on: June 26, 2023, 09:00:52 AM »
That would be "LV" - as in <L>ist <V>ariables - to list the variable names.
Use DUMP to display their contents, or SD (<S>earch <D>ump) for more specific info. See the manual for details.
« Last Edit: June 26, 2023, 09:06:12 AM by James Zukowski »
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services