Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening Excel from VB .NET application
I'm trying to open various Excel files to determine which ones are not in a valid format. I have the following snippit of code: Try Dim bDisplayAlertsOldValue Dim workBook As Excel.Workbook bDisplayAlertsOldValue = m_excelApp.DisplayAlerts m_excelApp.DisplayAlerts = False workBook = m_excelApp.Workbooks.Open(fileName) workBook.Close(False) m_excelApp.DisplayAlerts = bDisplayAlertsOldValue Catch ex As Exception MsgBox(ex.ToString()) End Try The problem I'm encountering is this. If I don't disable the DisplayAlerts property, then Excel prompts the user with the standard file is in incorrect format dialog. My application is going to run without user interaction over many excel files. If I disable the DisplayAlerts property, Excel no longer throws the exception that I was catching after the dialog. Any ideas? -Dan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel opening from other application | Excel Discussion (Misc queries) | |||
Opening Excel 2007 application | Excel Discussion (Misc queries) | |||
Opening Excel Application difficulty | Excel Discussion (Misc queries) | |||
Opening a different application from Excel | Excel Programming | |||
Slow-Opening Excel Application | Excel Programming |