ADO + Excel = Read Only Excel Sheet

ADO + Excel = Read Only Excel Sheet

Post by Fergu » Sat, 23 Oct 2004 18:06:03


Hi,

When I open an Excel ODBC connection, I cannot edit the Excel sheet in
Excel. Excel reports that the "filename is locked for editing"

If I open the Excel sheet before the code executes then everything works
okay and the connection appears to be read only.

Does anyone have any ideas ?

Ferg.
VB 6.0SP5
ADODB 2.8
------code start------
Set xlsConn = New Connection
Set xlsRs = New ADODB.Recordset

tmpConn.Open "Driver=Microsoft Excel Driver (*.xls);DBQ=" + xlsSheet +
";ReadOnly=1"
------code finish------
 
 
 

ADO + Excel = Read Only Excel Sheet

Post by Val Mazu » Wed, 27 Oct 2004 12:27:58

Hi,

Did you try to use Jet 4.0 OLEDB provider? See next KBs with some
suggestions, limitations and examples how to work with Excel using ADO

http://www.yqcomputer.com/ ;EN-US;257819

http://www.yqcomputer.com/ ;en-us;278973

http://www.yqcomputer.com/ ;en-us;295646

--
Val Mazur
Microsoft MVP

 
 
 

ADO + Excel = Read Only Excel Sheet

Post by Paul Cleme » Fri, 29 Oct 2004 03:03:51


Hi,

When I open an Excel ODBC connection, I cannot edit the Excel sheet in
Excel. Excel reports that the "filename is locked for editing"

If I open the Excel sheet before the code executes then everything works
okay and the connection appears to be read only.

Does anyone have any ideas ?

In Excel try clicking on Tools...Share Workbook and make sure the "Allow changes by more than one
user at the same time" option is selected.

I seem to recall that Microsoft does not recommend concurrent access via Excel and the Data Access
methods (DAO, ADO, etc.).


Paul ~~~ XXXX@XXXXX.COM
Microsoft MVP (Visual Basic)