PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Open Excel File Just To View In Text Base PVX17  (Read 273 times)

Skip.Dahl

  • Member
  • **
  • Posts: 10
    • View Profile
Open Excel File Just To View In Text Base PVX17
« on: July 19, 2021, 10:42:23 PM »
Running text base app in the plant that when a part is found to have a
spreadsheet that contains detail for shipping info, I thought I had at
one time read that a spreadsheet could be opened to view and then closed
while in a Pvx app, no modification of spreadsheet required? 

Devon Austen

  • Staff
  • Diamond Member
  • *****
  • Posts: 293
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: Open Excel File Just To View In Text Base PVX17
« Reply #1 on: July 20, 2021, 08:22:22 AM »
You can use the [ODB] ODBC interface to work with Excel files via the Excel files ODBC driver. https://manual.pvxplus.com/PXPLUS/command_tags/odb.htm.

You can define a DSN pointing at the files you want to access using the ODBC Data Source Administrator. You can also just define everything in the [ODB] open.

Another option would be to use the Excel object. https://manual.pvxplus.com/PXPLUS/PxPlus%20User%20Guide/External%20Components/PxPlus%20COM%20Support/Excel%20Object.htm.

This allows you to actual control the Excel application in the background so you may want to use the object to hide Excel if you just want to read the data. The benefit of this object is it gives you full control.

If reading is all you want to to the [ODB] is probably easiest.
Software Developer for PVX Plus Technologies LTD.

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3496
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Open Excel File Just To View In Text Base PVX17
« Reply #2 on: July 20, 2021, 11:54:13 AM »
Skip

How are you wanting to use the Excel file?

You mentioned a Text Based application, so if not running WindX then you would need to access the Excel file from the host using ODB.  Now if the host is Windows you could also use the Excel object we provide.

If you are running WindX you can access the EXCEL data from the Workstation using ODB, the Excel object or DDE.

Now if you want to display the Excel spreadsheet, then DDE or OLE (using the DEF OBJECT) is the way to go.

Skip.Dahl

  • Member
  • **
  • Posts: 10
    • View Profile
Re: Open Excel File Just To View In Text Base PVX17
« Reply #3 on: July 20, 2021, 03:53:31 PM »
Yes, the end user is running WindX.    The program I have running in their shipping dept is a text based app,
so when a part is entered for packing (ex. 12-422-6) I will have the program look on the Linux server
in a specific directory for an Excel spreadsheet for that part (12-422-6.xlsx) it will notify
the user if found that a spreadsheet for part exist, during the prompt if the user selects to view, I would like
within ProvideX to open the spreadsheet into an Excel window so that he could scroll thru and then close out
of the Excel window when done.

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3496
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Open Excel File Just To View In Text Base PVX17
« Reply #4 on: July 20, 2021, 04:04:55 PM »
First off I assume that Excel is installed on the workstation.

If so you should be able to copy the spreadsheet file to the workstation then use SYSTEM_HELP to open the file.  If you only want them to access a single excel file at a time, you might be able to use a consistent file pathname on the workstation.

Alternatively, you could mount the directory containing the excel files so that the windows system can directly access the files using a UNC pathname == something like \\server\excelfiles\xxxxx.xlsx -- then execute a SYSTEM_HELP UNC$ where UNC$ has the UNC string.  If you do this make sure the UNC is read only.