08-14-2017 03:14 AM
Thanks for the response, will have to think about how to go ahead. I'll open a service request to see if NI knows anything more.
08-15-2017 03:22 AM
In case anyone else comes across this in future, here is what I got from NI together with my own research:
Nothing much new, but all confirmed what we know, and no fixes other than the mentioned workarounds.
Interestingly, if you open the 2016 version of the VI in 2017, it is fixed. This is because the VI is recompiled so parameters are retrieved fresh.
08-17-2017 09:05 AM
One thing to note is that you don't actually need to have Office installed in order to install the Report Generation Toolkit. I have LV2015 installed on an XP virtual machine for building backward-compatible executables, and even though it doesn't have Office installed, I was able to install the toolkit and build executables which also run fine on Windows 7 and work correctly with Office 2016 and earlier. Microsoft sill has the "Windows XP Mode" Virtual PC that dates back to the release of Windows 7 available for download free, which is a convenient way to set it up.
10-13-2017 11:57 AM
I have come up against this issue over the past couple of days as well. I have found what I believe to be a decent workaround for now: changing the method call to SaveCopyAs (right-click on the Invoke Node -> Select Method -> SaveCopyAs). The file will still be saved with the name/location that is passed into the vi. The difference is that the file that is created and open will be a copy and not be saved. I have only tested this with the workbook being left open when the report is disposed (the default is to close the file). This avoids the application from crashing on either Office/Excel configuration.
For some further information that I believe could be helpful:
It seems that it is related specifically to a later version of Office 365. If others could verify that they have only seen this issue with Office 365 updates (and possibly specific versions), that might be helpful.
One of my coworkers has Office 365 installed and does not have this issue. His vi with the SaveAs method is without the additional WorkIdentity parameter and his applications are not crashing when he saves the workbook using the RGT vi's. My version does have the WorkIdentity and does crash when I put it on a different machine with Office 2013/6.
The change apparently occurred sometime after 19 July 2017 and between builds 6965 and 8201.
Oddly enough, both of us are loading the Excel._Workbook.SaveAs Method from "Microsoft Excel 16.0 Object Library Version 1.9" - the same version of the object library, but with different results. When he opens his Class Browser and selects the SaveAs Method (from that library and the Excel._Workbook Class), the WorkIdentity parameter is not there. When I open mine, it is there.
I hope the workaround will help. I don't know if the additional information will help, but that is what I have found out in the past couple of days.
10-13-2017 12:33 PM - edited 10-13-2017 12:40 PM
My SaveAs has the WorkIdentity parameter, and I don't have Office 365, I have Office Home and Business 2016, version 1708, build 8431.2079 Click-to-Run.
Edit: I just installed an update to build 8431.2107, and it's still there.
10-13-2017 01:20 PM
Thanks arteitle! So yours is a Click-to-Run (C2R) application. I thought all of the perpetual Office installs were msi based. So instead of it being related to the version of Office 365, it might be related to the versions > 1609 of a C2R based Office conflicting with the msi based Office installations.
One more difference in my configuration and my coworkers.
10-16-2017 03:39 AM
The change occurred with version 1609 which is build 7369.2055. So your colleague has the "older" version.
My workaround is to check the build of excel installed (attached VI) then for old versions don't use the save function.
The behaviour below prompts the user to save on close, so all that is lost is the ability to set the filename programmatically without user input, which is annoying but better than not being able to generate the report or just crashing.
Hope this is helpful to someone, it's a pain explaining to managers/customers why suddenly this years release has problems with data export to excel.
As mentioned by JM before, another solution is to do the builds on a VM or other machine with old excel on. I decided not to do this in the end due to the overheads.
10-24-2017 01:53 PM
Thanks for the workaround on getting the build! I was trying to get something similar but with no luck.
As far as a workaround, I like the SaveCopyAS alternate. It will still save a copy with the programmatic path/filename that you provide. The copy that remains is just that, a copy. For my application, manually entering the filename could easily cause files to be orphaned/missed/miscategorized/lost.
10-25-2017 03:57 AM
Ian,
This is great thank you. So am I reading right that from LabVIEW 2017 it HAS to run with the newer Excel build? I would have hoped they might be able to put that flag around the invoke node to handle both somehow otherwise that is a nasty backwards compatibility issue to watch out for.
Cheers,
James
11-03-2017 10:21 AM
@James_McN wrote:
Ian,
This is great thank you. So am I reading right that from LabVIEW 2017 it HAS to run with the newer Excel build? I would have hoped they might be able to put that flag around the invoke node to handle both somehow otherwise that is a nasty backwards compatibility issue to watch out for.
Cheers,
James
I haven't tested that, but it does look like that might be the case. However, this is the same as what I deal with in 2016 since I recompiled the toolkit (to make it run at all) so it has the new parameter anyway. Guess it will just be left to developers to figure out. SaveCopyAs might be a good workaround, would have to add it into the report gen subVIs though as we can't extract the reference from the class.