Groups | Blog | Home
all groups > dotnet interop > april 2006 >

dotnet interop : Error entring values the cells in Excel from the VS 2005 env


tomer
4/30/2006 8:07:01 AM
when running the following code in the VS 2005 environment
(AxWebBrowser1 is a microsoft web browser):

Public Class Form1

Dim WB As Microsoft.Office.Interop.Excel.Workbook

Private Sub AxWebBrowser1_NavigateComplete2(ByVal sender As Object,
ByVal e As AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event) Handles
AxWebBrowser1.NavigateComplete2
WB = e.pDisp.Document
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
AxWebBrowser1.Navigate("c:\test.xls")
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
WB.Worksheets(1).Range("b4") = "AAA"
End Sub
End Class

I recieve the error :

Exception from HRESULT: 0x800A03EC


Please can anybody help?

tomerk NO[at]SPAM aman.co.il
5/16/2006 4:09:16 AM
try using these code lines :

Dim oldCI As System.Globalization.CultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US")

'Your Code
WB.Worksheets(1).Range("b4") = "AAA"

tomerk NO[at]SPAM aman.co.il
5/16/2006 4:10:16 AM
try using these code lines :

Dim oldCI As System.Globalization.CultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US")

'Your Code
WB.Worksheets(1).Range("b4") = "AAA"

tomerk NO[at]SPAM aman.co.il
5/16/2006 4:11:06 AM
try using these code lines :

Dim oldCI As System.Globalization.CultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US")

'Your Code
WB.Worksheets(1).Range("b4") = "AAA"

AddThis Social Bookmark Button