VB.Net reference to COM "Microsoft Excel 16.0 Object Library": No WorkbookQuery (???)

  • Thread starter Thread starter Peter Ferber
  • Start date Start date
P

Peter Ferber

Guest
I am on a long overdue project to upgrade my VB6 code to VB.Net, and I'm starting that process with Visual Studio 2008: the lowest rung on a series of upgrades.


In my vb6 code, I have defined a WorkbookQuery, as follows:


Dim MyQuery As Excel.WorkbookQuery



During my upgrade to VB.Net, I have used the "Microsoft Excel 16.0 Object Library" reference, to make the above command functional. When I ran the conversion routine to upgrade my VB6 to VB.Net, the upgraded code translated the line above as follows...


Dim MyQuery As Microsoft.Office.Interop.Excel.workbookquery


...yet, the line is flagged with the error that the above definition "Microsoft.Office.Interop.Excel.workbookquery" is unresolved, which I find peculiar, yet the Object Browser shows that under Microsoft.Office.Interop.Excel, no definition for "workbookquery" exists!


As the corresponding roster of standard Excel objects, for which is present and accounted -- i.e., Excel.Application, Workbook, Worksheet, etc. --, I am left to conclude that VB.Net somehow downgraded "Microsoft Excel 16.0 Object Library" to a version that preceded the invention of WorkbookQuery, and I want to know the mechanism by which this happened and what techniques will overcome it.


Nearly all of my references are to DLL's, but my Excel reference, for both VB6 and VB.Net, are to the Excel executable, below, and I am curious if this fact impacted the translation from VB6 to VB.Net. Also, if a version of the executable could be exported as a DLL, would that insure that a clean, non-downgraded version?


C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE


Any insight would be very much appreciated! My thanks, ~ Peter Ferber

Continue reading...
 
Back
Top