Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 Adding a reference to Microsoft.Office.Interop.Excel disables New DataTables

$
0
0
Hi:

I had some code working to my satisfaction. As a final step, I added a reference to 'Microsoft.Office.Interop.Exce', and now my Data Tables produce errors. Apparently, I am no longer allowed to instantiate a DataTable.

Code:

Imports System.Data.OleDb
Imports Microsoft.Office.Interop.Excel


Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim ds1 As String = "\\stylmark.com\fs-styl\Public\HISTORY\icedet 12mos122912.xlsx"
        Dim ss1 As String = "SELECT [Item], [SONbr], [OrdDate], [Eng], [Cfg#Rev] FROM [MASTER$] " & _
                            "ORDER BY [Item] DESC "
        Dim dt1 As New DataTable
        dt1.Columns.Add("Item", GetType([String]))

---

I have n attachment that illustrates the problem.

Thanks in advance for the help.
Attached Images
 

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>