D
Darren Barrick via .NET 247
Hello All!
I am using Office Automation in one of my applications in orderto read/write to an excel spreadsheet from a VB.Net application.
I thus create the application with
ExcelApplication = New Excel.Application()
I wish to keep my application hidden, and thus I use
ExcelApplication.Visible = False
This all works fine. Excel stays hidden (although it does show inthe process list ? I can live with this). However, the problemoccurs when the user loads a workbook outside of my application.
Excel attaches itself to my ExcelApplication Object !! What?sworse is that it makes my currently hidden workbook visible.
Initially I considered that I could just hide individualworkbooks. However, there are two problems with this approach.
1. I with to set ExcelCalculation to manual, and this is anapplication wide property. If I allow Excel to attach itself tomy excel object then I will have no choice but to setExcelCalculation to automatic, slowing things down (some of thecalculations being performed by excel are fairly involved)
2. When the user closes the application (with hidden workbooks),the process will die. I can always check for this and reloadexcel ? but this is an acquired solution and it will becompounded by the calculation issues described in (1).
Ideally, what I want to do is stop Excel attaching itself to myExcel instance. However, any suggestions would be more thanwelcome.
Thank you in advance
Darren Barrick
I am using Office Automation in one of my applications in orderto read/write to an excel spreadsheet from a VB.Net application.
I thus create the application with
ExcelApplication = New Excel.Application()
I wish to keep my application hidden, and thus I use
ExcelApplication.Visible = False
This all works fine. Excel stays hidden (although it does show inthe process list ? I can live with this). However, the problemoccurs when the user loads a workbook outside of my application.
Excel attaches itself to my ExcelApplication Object !! What?sworse is that it makes my currently hidden workbook visible.
Initially I considered that I could just hide individualworkbooks. However, there are two problems with this approach.
1. I with to set ExcelCalculation to manual, and this is anapplication wide property. If I allow Excel to attach itself tomy excel object then I will have no choice but to setExcelCalculation to automatic, slowing things down (some of thecalculations being performed by excel are fairly involved)
2. When the user closes the application (with hidden workbooks),the process will die. I can always check for this and reloadexcel ? but this is an acquired solution and it will becompounded by the calculation issues described in (1).
Ideally, what I want to do is stop Excel attaching itself to myExcel instance. However, any suggestions would be more thanwelcome.
Thank you in advance
Darren Barrick