Take the 2-minute tour ×

When I import Microsoft.Office.Interop.Excel (with added com-reference to Excel Object library), it seems to shadow some datatypes and objects. I have to qualify DataTable everywhere to System.Data.DataTable. I did however not find a way to use the Application-object any more at all. I tried My.Application, but that's different (does not have Application.StartupPath for example). a) Where can I find the Application object, or b) Is there a way to hint the IDE to use eg. System.Data.DataTable by default when I use DataTable? (sorry about formats, writing from cell phone)

share|improve this question
my.application is not windows.forms.application ... which contains the property StartupPath –  igrimpe Nov 16 '12 at 8:46
Ah yes thanks, I just didn't find that. –  KekuSemau Nov 16 '12 at 13:36

1 Answer 1

up vote 0 down vote accepted

As for the shadowing, I think it's best to simply not use the import line in any module, but using everything for Excel fully qualified like Dim xlApp As Microsoft.Office.Interop.Excel.Application. That seems easier to me than having other data types messed up.

share|improve this answer

Your Answer


