LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Writing to Excel using ASP.NET

Private Sub Page_Load(ByVal sender As System.Object, ByVal e A
System.EventArgs) Handles MyBase.Load

Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Dat
Source='C:\Timmy\Demographic Application\CENTRAL.XLS';Extende
Properties=""Excel 8.0;HDR=NO"""
Dim conn As New OleDbConnection(strConn)
Dim strSQL As String = "UPDATE [General$A86:A86] SET F1
2000"
Dim cmd As New OleDbCommand(strSQL)
cmd.Connection = conn
conn.Open()
Dim rows As Integer = cmd.ExecuteNonQuery()
cmd.Connection.Close()
conn.Close()
conn = Nothing
End Sub

Hi!

I found the following code (or very similar) in an example. I want t
write to the A86 cell of the General sheet in the workbook mentione
in the connection string. However, the problem is that after I run th
asp.net test example above, and then try to open the spreadsheet, Exce
says that there is a "memory write problem" and also that it is locke
for editing. I cannot even delete the spreadsheet because Windows say
there is a sharing violation. I do not know what is really wrong wit
the above code as I practically copied it from the MSDN website.
would greatly appreciate any help!

Thanks!
Timoth

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing Macro in Excel 07 Tony Excel Worksheet Functions 3 July 4th 09 02:11 AM
need help writing a formula in excel Marco New Users to Excel 1 March 26th 08 08:34 PM
Writing Tool for Excel [email protected] Excel Discussion (Misc queries) 4 May 31st 07 01:40 PM
Writing macro in Excel CCB AA Excel Worksheet Functions 2 January 31st 06 08:48 PM
Help writing an Excel Formula bella0711 Excel Worksheet Functions 4 September 9th 05 03:57 PM


All times are GMT +1. The time now is 02:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"