LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stand-alone application to save Excel file developed in PC with Office 2016 running in PC with Office 365

Solved!
Go to solution

Hi people,

I have developed a stand-alone application which using the activeX opens an excel template file (*.xlt) fills it with some data and then saves alternatively an Excel file (*.xlsx) or directly a PDF file (*.pdf). In the development machine is installed Excel 2016 32-bit, running it in a machine with the same Excel version everything works properly.

Now am trying to run it in a machine in which is installed Excel 365 MSO (Version 2508 Build 16.0.19127.20192) 32 bit, the part of the application which saves the file fails if the format chosen is Excel (*.xlsx), everything works if the format chosen is PDF (*.pdf), despite I use the same reference for the activeX, the workbook, the worksheet and so on, the only difference is the "ExportAsFixedFormat" method for PDF instead of "SaveAs" method for XLSX. Also the saving location is the same.

I think the "SaveAs" method is present in both version of activeX.

 

Does anyone knows a workaround? I would like to avoid to modify the application.

0 Kudos
Message 1 of 12
(326 Views)

What can you tell us about the version of LabVIEW you are using?  What year, patch/Q level, 32-or-64 bit, and "flavor" (Base, Full, Professional, Academic, Community)?  [I gave up Active X more than a decade ago when I discovered the Report Generation Toolkit ...].

 

Bob Schor

0 Kudos
Message 2 of 12
(297 Views)

Check Report Generation Toolkit and Microsoft Office and LabVIEW Compatibility

 

By any chance, are you also trying to run the EXE on a different Windows? From Running Executables or Installers on Different Windows Versions

Installers and executables are only guaranteed to work on the operating system they are built on. For example, a Windows 10 installer or executable may not work as expected on a different Windows version (e.g. Windows XP, Windows 8, or Windows 7).

 

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 3 of 12
(266 Views)

Hi ICO,

 


@ICO_82 wrote:

the only difference is the "ExportAsFixedFormat" method for PDF instead of "SaveAs" method for XLSX.

 

Does anyone knows a workaround? I would like to avoid to modify the application.


Microsoft is known to change the properties of the SaveAs method with each Office version: unfortunately you need to provide LabVIEW code suitable for each Office version!

(Your question comes up frequently, so please search the forum more intensively! I remember for a very similar thread with RolfK involved in answering basically same question…)

 

So the generic answer is: you need to modify your application.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 12
(251 Views)

Labview 2015 SP1 32 bit, I think the problem is excatly in the differences between the activeX of the two office versions.

0 Kudos
Message 5 of 12
(232 Views)

I am not using the report generator toolkit

0 Kudos
Message 6 of 12
(231 Views)

Hi ICO,

 


@ICO_82 wrote:

I am not using the report generator toolkit


RGT also uses ActiveX under the hood, so you would end up with the same problem…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 12
(219 Views)

Hi GerdW, believe me I have searched for log time how to manage ActiveX for different versions but what I find is just install the office version in the developing machine. I would like to understand if it is possible to "adjust" office in order to be compatible.

0 Kudos
Message 8 of 12
(210 Views)

I have a similar problem. Developed executable with LV2021 for Windows 10 and Excel 2016. If I recreate the same executable using LV2021 on Windows 11 and Excel 365 it will fail on the PC using Excel 2016 when it goes to save the Excel file. It's because the Save As ActiveX for each version is slightly different. I think the solution if you want to still use ActiveX is to create the executable using the same Excel version that the executable will be deployed to.

ooth_0-1758017729884.png

Edit: also the both 2016 version and 365 version are 64 bit.  

 

Message 9 of 12
(195 Views)