Dim oApp As New Excel.Application() Dim wb As Excel.Workbook Dim oldCI As System.Globalization.CultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US") wb = oApp.Workbooks.Open("D:\NoriaMail\23120011\LPO Summary per Month_View 3 - All Months.xlsx") 'oApp.Workbooks. System.Threading.Thread.CurrentThread.CurrentCulture = oldCI oApp.Visible = False Dim cmdText As String Dim cmdType Dim connStr cmdText = wb.Connections.Item(1).OLEDBConnection.CommandText cmdType = wb.Connections.Item(1).OLEDBConnection.CommandType wb.Connections.Item(1).Delete() connStr = "OLEDB;Provider=SQLOLEDB.1;" & _ "Password=sa;" & _ "Persist Security Info=True;" & _ "User ID=sa;" & _ "Initial Catalog=Northwind;Data Source=." wb.Connections.Add("NORIA", "", connStr, cmdText, 2) wb.RefreshAll() 'wb.Close(False) wb = Nothing oApp = Nothing ' oApp.Quit() GC.Collect() 'wb.Close(True, "D:\NoriaMail\23120011\LPO Summary per Month_View 3 - All Months.xlsx", False) 'oApp.Visible = False WebBrowser1.Navigate("D:\NoriaMail\23120011\LPO Summary per Month_View 3 - All Months.xlsx") 'oApp.Visible = False End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)