Page 1 of 1
Unfortunate glitch using wfopen to read Excel files
Posted: Wed May 04, 2016 10:38 am
by gabrielehrlich
My group has been experiencing an unfortunate glitch using wfopen to read data from Excel 2010 files. If we have an Excel workbook open and we simultaneously use wfopen to read the data in it into Eviews, Excel no longer prompts us to save when we close the Excel workbook (even if we have made changes). Annoyingly, Excel no longer prompts us to save when we close
any other workbooks we had open either. We have to exit Excel completely for the save prompt to come back. Here is an example of some code that causes problems:
Code: Select all
%targetsfile = %pathname + "targets.xlsx"
wfopen(wf=targets) %targetsfile range=sheet1
'Now try making a change in the targets.xlsx file and closing it - Excel should not prompt you to save
'Also try making a change to any other workbook you have open simultaneously and closing that - Excel should also not prompt you to save
Have other people had this issue? (We did not find this exact issue on the forum.) If not, we would like to make EViews aware of it. Thanks!
Re: Unfortunate glitch using wfopen to read Excel files
Posted: Wed May 04, 2016 2:07 pm
by EViews Jason
We are not seeing the problem described in your text. What version of EViews and Excel are you using?
If you change the excel file, regardless if you use wfopen, Excel always asks to save.
NOTE: In your example, you said
Code: Select all
'Now try making a change in the targets.xlsx file and closing it - Excel should not prompt you to save This is contradictory to your original statement. Excel should prompt in this case.
Re: Unfortunate glitch using wfopen to read Excel files
Posted: Wed May 04, 2016 5:33 pm
by gabrielehrlich
Thanks, Gareth. We are using Eviews 9 Enterprise Edition (October 22, 2015 build) and Excel 2010. I don't see the contradiction in my original post. On our machines, when we use wfopen to read data in from the Excel file while it is open, and subsequently make a change to the Excel file, Excel will no longer prompt us to save upon exiting.
Perhaps my use of "should" was unclear - in a normative sense, I certainly agree that Excel should prompt me to save - the problem is that it doesn't prompt me to save. My statement "Excel should not prompt you to save" was meant to be predictive - if you experience the same problem we are having, Excel will not prompt you to save after using wfopen to read data from an open workbook.
Thanks for any thoughts.
Re: Unfortunate glitch using wfopen to read Excel files
Posted: Wed May 04, 2016 5:50 pm
by EViews Steve
This sounds really strange.
When Excel has the file open, it locks the file. This means that when EViews tries to read the file, we have to ask Excel via COM for the data. During that procedure we do not tell Excel to save any changes or to ignore any changes upon close.
My guess is that this is a problem with Excel or one of its addins. Since we can't reproduce it here, try disabling all Excel addins, restart both Excel and EViews and try the import again.
Also you mentioned the excel 2010 as the file type. Are you running excel 2010 or something newer?
Steve
Re: Unfortunate glitch using wfopen to read Excel files
Posted: Thu May 05, 2016 9:13 am
by EViews Jason
After you close the modified excel file which does not prompt to save (when it should) and reopen the file are your changes there?
So the question is, does Excel not prompt because a)it thinks the file has already been saved or b)it thinks the file has not been modified and therefore does not need to prompt to save?
Re: Unfortunate glitch using wfopen to read Excel files
Posted: Sat May 07, 2016 1:29 pm
by gabrielehrlich
Thanks for your support on this issue, Steve and Jason.
Steve, we are running Excel 2010. We just tried disabling all of the add-ins and restarting the programs, and the problem persisted.
Jason, when we reopen the Excel files, the changes are NOT there. So the answer seems to be b)it thinks the file has not been modified and therefore does not need to prompt to save.
Re: Unfortunate glitch using wfopen to read Excel files
Posted: Mon May 09, 2016 9:12 am
by EViews Steve
Ah, I was able to reproduce the problem and I found the issue. It turns out we were telling Excel to suppress all user dialogs while we were using it. I've changed this to only suppress while we are actively reading data, then reverting that setting back to the original value once we're done with the actual import.
This fix will be released in the next patch.
Steve
Re: Unfortunate glitch using wfopen to read Excel files
Posted: Wed May 11, 2016 11:52 am
by gabrielehrlich
Thanks very much, Steve!
Gabe
Re: Unfortunate glitch using wfopen to read Excel files
Posted: Wed May 11, 2016 11:53 am
by EViews Steve
Patch was released today.