Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Unlocking protected Sheet from ASP.NET

I need to write to a protected excel worksheet. So far i have code which can
write to an unprotected sheet as below:

Help would be much appreciated

++++++++++++++++++++++++++++++++++++++++++++++

Private Sub WriteIDtoXL(ByVal str)
Dim conn1 As New System.Data.OleDb.OleDbConnection(xlConn(str))
conn1.Open()

Dim cmd As New System.Data.OleDb.OleDbCommand
cmd.Connection = conn1
cmd.CommandText = "INSERT INTO [CCID] (ID) values (" &
Session("mCallCentreID") & ")"
cmd.ExecuteNonQuery()
conn1.Close()

End Sub

Private Function xlConn(ByVal FilePath As String) As String

xlConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
FilePath & ";Extended Properties=""Excel 8.0;HDR=YES;MAXSCANROWS=4"""

End Function

++++++++++++++++++++++++++++++++++++++++++++++++++ +++
Reply
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
Unlocking a protected sheet Sherry S Excel Discussion (Misc queries) 3 April 22nd 09 06:46 PM
Unlocking Protected Cells Biff Excel Worksheet Functions 1 January 12th 09 07:38 PM
Unlocking protected cells Vanilla Skies Excel Worksheet Functions 0 September 26th 06 04:04 AM
Unlocking Cells when a worksheet is protected... racmb1975 Excel Discussion (Misc queries) 2 May 3rd 05 08:57 PM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi[_5_] Excel Programming 1 May 2nd 04 03:50 PM


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

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

About Us

"It's about Microsoft Excel"