1. Raman Dhillon
  2. PowerBuilder
  3. Friday, 7 July 2023 21:44 PM UTC

We have application that saves reports to Excel file using Oleobject and does data formatting after file is saved.   This stopped working after MS Office was uninstalled form Citrix server due to company new policy.   The file does get saved but error on any excel related function call.

For example, there is error file is to open in PowerScript:

lole_excel = Create OLEObject
ll_ole_handle = lole_excel.ConnectToNewObject("excel.application")

lole_excel.Application.Workbooks.Open(file1.xls)

Error text = Error accessing external object property application .....

Is there any workaround for this issue when MS office is not there on the host server? May be PB provide inbuilt Excel DLL or plug-in?   We are on PB 2022 version

Thanks in advance for your help.

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 10 July 2023 09:22 AM UTC
  2. PowerBuilder
  3. # 1

For your server without Office installed, you can write a C# DLL that uses OpenXML: It's a bit old article, but should push you in the right direction:

https://technowide.net/2015/11/03/openxml-alternative-helps-avoid-ms-excel-server/

regards.

Comment
There are no comments made yet.
Clarence Chamorro Accepted Answer Pending Moderation
  1. Sunday, 9 July 2023 16:22 PM UTC
  2. PowerBuilder
  3. # 2

I use 3rd party DW2XLS product to export & format Excel files. It work perfect and it does a great job and it is not expensive at all.

 

REgards,

 

Clarence

Comment
  1. mike S
  2. Sunday, 9 July 2023 17:34 PM UTC
  1. Helpful 1
  1. Miguel Leeuwe
  2. Sunday, 9 July 2023 18:31 PM UTC
Hi Clarence,

Myself I also use DW2XLS, but the OP wants to do some "Data formatting". Correct me if I'm wrong, but I don't think that's possible with dw2xls.

regards.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Sunday, 9 July 2023 06:36 AM UTC
  2. PowerBuilder
  3. # 3

Maybe you could write a c# .Net DLL and import the functions using the DLL import tool.

This might be a solution for what you want: https://scand.de/produkte/gspread/ I have never used it myself, so no guarantees.

However, it's licensed under GPL v3, so I'm not sure if that would mean that your application then also has to be GPL v3. I never understand these GPL licenses.

They also have a "commercial" license, but I don't know how expensive it is.

regards.

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Saturday, 8 July 2023 18:20 PM UTC
  2. PowerBuilder
  3. # 4

Hi, Raman -

I believe Miguel is correct. An OLE server, an OLE component that accepts requests made by an application, passes those requests to the "server" (Excel, in this case) and returns the requested information, cannot function without Excel being available on the same system, as I understand how OLE works.

If Chris has details on how/what you can change in your application to allow it to work with Office365's Document Object Model, then I suggest you ask him for that information.

Regarding your related question: Since I'm not an Appeon representative, I am unable to say definitively, but please realize there is a BIG difference between saving information that uses published formats (.xls and .xlsx, in this case) and creating/distributing software that mimics proprietary software (such as Excel)... so I very much doubt that Appeon will want to or legally be able to provide an Excel-like OLE server component with PowerBuilder.

When your company's management makes policy decisions like removing software, regardless of the reason(s), they need to understand and accept the consequences.

Best regards, John

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Saturday, 8 July 2023 15:40 PM UTC
  2. PowerBuilder
  3. # 5

Yes, I don't think you can use OLE with Office if Office is not installed.

regards.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Saturday, 8 July 2023 00:05 AM UTC
  2. PowerBuilder
  3. # 6

Hi Raman;

  FWIW: PB has had built-in Excel (and other formats) file generation since PB version 2.0. Have a look at the SaveAs() command.

  Also, you can use the 3rd party DW2XLS product to export & format Excel files (it does a great job too).

  The OLE route BTW still works .. you just need to adjust your OLE command structure to match the new Office365 DOM (document object model).

HTH

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.