PxPlus User Forum

Main Board => Discussions => Language => Topic started by: James Zukowski on May 27, 2022, 02:37:04 PM

Title: Excel, .COM, and OneDrive
Post by: James Zukowski on May 27, 2022, 02:37:04 PM
Last weekend, I had some automatic updates done to my Windows 10 PC that caused some problems with the PxPlus Excel object. I'm not sure exactly what component changed, nor to what degree, and was wondering if anyone else had experienced this.

We've been able to create an Excel workbook from PxPlus with a null filename, and it would accept it, assuming something like "Book1.xlsx" in the "[My] Documents" folder as the default filename. After the update, this didn't work anymore. It took quite a while to narrow down, but I eventually discovered that a null filename could no longer be supplied to the CreateWorkbook method. Providing a name resolved the problem.

I know the PxPlus Excel object did not change. I'm not sure what else did. Others on our team have not yet been updated, so they're not experiencing this...yet.

Has anyone else run into this problem? Is this something that can be corrected, or do we just have to work around it like we have?

Thanks, all!
Title: Re: Excel, .COM, and OneDrive
Post by: Susan Cryderman on May 27, 2022, 03:18:56 PM
James,

I just tried it here and it still seems to work for me.  Did Excel itself get updated?  What version of Excel are you running?

Susan Cryderman
PxPlus Technologies Ltd.
Title: Re: Excel, .COM, and OneDrive
Post by: James Zukowski on May 27, 2022, 05:09:05 PM
It looks like Excel did have an update, based on the program's modified date. I am currently using "Version 2108 (Build 14326.20962 Click-to-Run)"

Other team members are on different update schedules and may not have gotten what I have yet. Since our updates are managed by corporate folks, I'm not sure what was installed.
Title: Re: Excel, .COM, and OneDrive
Post by: Susan Cryderman on May 30, 2022, 09:19:10 AM
James,

Perhaps this is unrelated to the update ...

Is it possible that the default Book1.xlsx file already exits and was opened or in use elsewhere?  The CreateWorkbook method  attempts to add a workbook and then tries to save it with the supplied path.  If no path is supplied, it will try to save it with the default path and may fail.  It may be easier to supply a path name - but you can also call the Create Workbook method with a second parameter - a flag telling the object to always overwrite the existing file (in this case Book1.xlsx).   

return_value=x'CreateWorkbook("",1)
Title: Re: Excel, .COM, and OneDrive
Post by: James Zukowski on May 31, 2022, 08:36:53 AM
The call did include the overwrite parameter already. That's why it was so confusing. And no, it was failing even when the file did not exist AND the overwrite param was set.
Definitely strange...
Title: Re: Excel, .COM, and OneDrive
Post by: James Zukowski on May 31, 2022, 03:04:44 PM
Stranger still...
Everything now seems to be working properly.
I'm not sure what happened. There may have been another update in something else that affected the process. I'm following up on my end. If I find anything else, I'll update accordingly.
Title: Re: Excel, .COM, and OneDrive
Post by: Susan Cryderman on June 02, 2022, 09:10:01 AM
James,

I tried this again when I had book1.xlsx already opened in Excel and the x'CreateWorkbook("",1) did fail. 

Checking x'ERROR'Message$ returns the message Can not access 'Book1.xlsx'.


Susan
Title: Re: Excel, .COM, and OneDrive
Post by: James Zukowski on June 02, 2022, 10:05:44 AM
I would expect that to happen, and that was not the case here. I went directly to the process after a fresh reboot, and it errored. I was checking Excel'Error'Description$, but I don't recall the exact message at this time.
But now...no errors. All seems to be well. I have others checking into what updates were performed. Will keep you posted.