vb.net - Adding Excel Object Library conflicts between Excel.TextBox & Forms.TextBox in Office Development -


i have implemented several basic excel functions in vb.net application (opening xls workbook & accessing worksheet). however, appears when add reference "microsoft excel 14.0 object library" application getting confused standard system.windows.forms objects , has following error: invalidcastexception occured: unable cast object of type 'system.windows.forms.textbox' type 'microsoft.office.interop.excel.textbox'. invalid cast error happening when calling subroutine & passing application form controls (check boxes, gridview, textbox, etc) main "form1" class utilityfunction module. utilityfunction has reusable windows registry sub routine retrieves/saves values @ application startup/closing. worked in past, crashing @ subroutine call in form1 class. exception occurs during application runtime, not during compile/build.

also, deleted text controls form , created them manually, i'm still getting same exception error.

when have namespace conflict need qualify object want.

dim exceltb new microsoft.office.interop.excel.textbox dim formtb new system.windows.forms.textbox 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -