Excel file locked for editing even after deleting Excel server instance

Excel file locked for editing even after deleting Excel server instance

Post by Chiar » Sat, 11 Aug 2007 01:13:00


Hello Matlab users,

I am saving computation results to excel files using:

Excel = actxserver ('Excel.Application');
File=filename;
Excel.Visible =1; %added by chiara 9 Aug 2007
if ~exist(File,'file')
ExcelWorkbook = Excel.workbooks.Add;
ExcelWorkbook.SaveAs(File,1);
ExcelWorkbook.Close(false);
end
invoke(Excel.Workbooks,'Open',File);

[...]

invoke(Excel.ActiveWorkbook,'Save');
Excel.Quit
Excel.delete
clear Excel

when i am finished, i try to open the files but once in a while they
are locked for editing and remain so - such that i cannot overwrite or
even delete them. I do not have extra excel processes running, though.

Any tips would be appreciated.

Have a very nice day,
chiara
 
 
 

1. file lock with excel when file, close workbook instead of exiting Excel completly

2. How do I isolate my Excel server (automation) from other Excel instances?

Our application uses Excel as a server via the Excel COM interface
(automation). However, I'm finding that when the user opens other Excel
documents, these documents all share the same Excel window. If the user then
hits X to exit their document (this is the normal user approach) this shuts
down Excel altogether and my server is gone!

Also, our application streamlines the Excel window by removing all toolbars.
I'm finding that now when the user opens their own documents, their favorite
toolbars are gone. Again, it's the same basic issue. How do I isolate our
own Excel server from other instances of Excel in the user's environment?

Thanks for your help!

- Joe Geretz -

P.S. How come there's no excel.vba group like there is for Word?

3. Open new instance of Excel with each Excel file opened

4. opening and running macros in an Excel file in a new instance of Excel

5. Opening multiple Excel files from IE browser does not open in new instance of Excel - BUG?

6. How to read an excel file whitout opening Excel or instancing Exce

7. Opening multiple Excel files from IE browser does not open in new instance of Excel - BUG?

8. Excel 2003 - File Locked for Editing

9. Excel file - locked for editing

10. Excel Files Locked for Editing

11. Access, Excel, Word file lock up when edited

12. File always locked for editing following Excel Crash

13. Excel "file locked for editing"

14. Excel is displaying a file locked for editing message