Community discussion forum

I don't want the Excel workbook to be visible to the users

  • 11 months ago
    I have a VB.NET application and I am using following code to work on an existing Excel file. Private xlApp As Excel.ApplicationClass Private xlWbk As Excel.Workbook xlApp.Visible = False xlApp.DisplayAlerts = False xlWbk = xlApp.Workbooks.Open("c:\xlWbk.xls") While the application is running I don't want the Excel workbook to be visible to the users. As long as I am not opening an external Excel file (outside the application), everything works fine. However, when i am opening an external Excel file say, "a.xls", I can see my xlWbk.xls very much visible in front of me! This is 'dangerous' for the application as if the user closes this file, the application will cease to work! Is there a way I can hide the Excel file the application is using.. and still work on another external Excel file? Seems like the external Excel workbook is using the same instance of xlApp that was generated thru the code. So when i close any of the Excel files, the above application throws exceptions. Is there a workaround for the above? Thanks.
    Post was edited on 05/12/2008 04:36:11 Report abuse

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!