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
posted on 2007-12-29 02:20  Edison Zhu  阅读(182)  评论(0)    收藏  举报