Trouble Shooting: can not access Excel file using excel control
Solution:
Dim oApp As New Excel.Application()
oApp.Visible = True
oApp.UserControl = True
'Set current culture to en-US.
Dim oldCI As System.Globalization.CultureInfo = _
System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture = _
New System.Globalization.CultureInfo("en-US")
oApp.Workbooks.Add()
'restore the culture
System.Threading.Thread.CurrentThread.CurrentCulture = oldCI
Dim oApp As New Excel.Application()
oApp.Visible = True
oApp.UserControl = True
'Set current culture to en-US.
Dim oldCI As System.Globalization.CultureInfo = _
System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture = _
New System.Globalization.CultureInfo("en-US")
oApp.Workbooks.Add()
'restore the culture
System.Threading.Thread.CurrentThread.CurrentCulture = oldCI
浙公网安备 33010602011771号