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: 15
Default Excel Export to Access via VBA

Hi all.
Hopefully someone can point me in the right direction. Here's what I want to
do.
I want to be able to click on a command button and export whatever logs that
have been entered into the spreadsheet to be exported into an Access db with
the same field names as the spreadsheet. I've read several postings on here
but can't seem to get the coding down. I keep getting an error ont he first
line "user-defined type not defined". Below is the code I got from a
different posting here.
Any help is appreciated. Thanks.

Dim con As New adodb.Connection
Dim strcon As String
Dim strSQL As String

strcon = "Provider=Microsoft.Jet.OLEDB.4.0;"
strcon = strcon & "Data Source=U:\MY_CB_LOG1.mdb"
strcon = strcon & Persist Security Info=False"

con.Open strcon

strSQL = "INSERT INTO tbl_MAIN_CB_LOG "
strSQL = strSQL & "SELECT * FROM [Excel 8.0;Database=U:\MY_CB_LOG.xls].
[CB_DATA$]"

con.Execute strSQL

Set con = Nothing

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/201004/1

 
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
Excel Export to Access via VBA AccessUser777 via OfficeKB.com Excel Programming 0 April 28th 10 09:36 PM
Export from excel to Access GreatCrosby Excel Programming 3 May 22nd 09 02:39 PM
Excel export to Access MarcoR Excel Programming 5 May 17th 06 01:12 AM
export access to excel. change access & update excel at same time fastcar Excel Discussion (Misc queries) 0 June 24th 05 09:27 PM
Export from Access to Excel Sabina Excel Discussion (Misc queries) 3 February 23rd 05 09:56 PM


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