Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / May 2006

Tip: Looking for answers? Try searching our database.

Error entring values the cells in Excel from the VS 2005 env

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tomer - 30 Apr 2006 16:07 GMT
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@aman.co.il - 16 May 2006 12:09 GMT
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"

       System.Threading.Thread.CurrentThread.CurrentCulture = oldCI
tomerk@aman.co.il - 16 May 2006 12:10 GMT
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"

       System.Threading.Thread.CurrentThread.CurrentCulture = oldCI
tomerk@aman.co.il - 16 May 2006 12:11 GMT
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"

       System.Threading.Thread.CurrentThread.CurrentCulture = oldCI

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.