Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Linking two workbooks

In my view,Access is more suitable to store your information.
And with ADO,we can easily upload data from Excel to Access.
the following is an example.
================================================== ================================================== ============
Sub ExcelToAccessViaADO()
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset

Dim path, databasepsw As String
path = "d:\test.mdb"
databasepsw = "yourpassword" ' the database's password
cnn.Open "provider=Microsoft.Jet.OLEDB.4.0;data source=" & path & ";Jet
OLEDB:Database Password =" & databasepsw
rst.Open "dataTable", cnn, adOpenKeyset, adLockOptimistic, adCmdTable
'the "dataTable" is the table in Access

With rst
.AddNew
.Fields("Item1").Value = Cells(2, 37)
.Fields("Item2").Value = Cells(2, 38)
.Update
End With

rst.Close
Set rst = Nothing
cnn.Close
Set cnn = Nothing
End Sub
================================================== ================================================== ==========

"Bruise" <mkrupiarzATshaw.ca bl...
I am trying to link two workbooks. The source book has all the information
entered and stored. The other workbook will only be used by a limited
number of people to access designated information from the source workbook.
My problem is that the source workbook is password protected. When I open
the second workbook, I want it to update the information, but it asks for a
password to retrieve the information.

How would I set up a VBA code to automatically update the second workbook
with the source workbook and automatically enter the password so the user
doesn't need to know the password.

Does this make sense?

Help!!

Mark




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
Linking workbooks together IHSmw Excel Discussion (Misc queries) 1 August 14th 09 03:58 PM
linking workbooks Pennywis1 Excel Worksheet Functions 2 January 26th 07 08:30 PM
linking workbooks susie Excel Discussion (Misc queries) 2 August 17th 05 09:03 PM
Help linking workbooks Bartman Excel Discussion (Misc queries) 1 August 5th 05 12:50 AM
Linking workbooks Pat Excel Programming 2 December 8th 04 10:58 PM


All times are GMT +1. The time now is 08:39 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"