Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 3rd, 2008, 06:14 AM
hewstone999 hewstone999 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 30 hewstone999 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 30 m
Reputation Power: 7
Export Table data into an Excel SpreadSheet (VBA, ACCESS)

I have an export function below that will export my table "Test" to an Excel Spreadsheet.

However I want it so i can choose where that data in the "Test" table will go in the Excel Spreadsheet i.e. I want to export all the data in to Cell "B2" of the SpreadSheet - at the moment it will export all the data into "A1"

Any help or ideas?


Private Sub Command3_Click()

'Export function
'EXPORTS TABLE IN ACCESS DATABASE TO EXCEL
'REFERENCE TO DAO IS REQUIRED

Dim strExcelFile As String
Dim strWorksheet As String
Dim strDB As String
Dim strTable As String
Dim objDB As Database

'Change Based on your needs, or use
'as parameters to the sub
strExcelFile = "E:\CSC\LDMS\LDMSDatabaseApp\LDMS_Spec.xls"
strWorksheet = "WorkSheet1"
strDB = "E:\CSC\LDMS\LDMSDatabaseApp\LDMS_IFF_APP.mdb"
strTable = "Test"

Set objDB = OpenDatabase(strDB)

'If excel file already exists, you can delete it here
If Dir(strExcelFile) <> "" Then Kill strExcelFile

objDB.Execute _
"SELECT * INTO [Excel 8.0;DATABASE=" & strExcelFile & _
"].[" & strWorksheet & "] FROM " & "[" & strTable & "]"
objDB.Close
Set objDB = Nothing




End Sub

Reply With Quote
  #2  
Old March 15th, 2008, 04:29 AM
boblarson's Avatar
boblarson boblarson is offline
.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Location: Portland, Oregon, USA
Posts: 161 boblarson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 46 m 38 sec
Reputation Power: 7
Gave the answer to your other thread:

http://forums.devarticles.com/micro...ess-139732.html
__________________
Bob Larson
Former Access MVP
2008-2009, 2009-2010, 2011-2012


Free Access Samples and Tutorials: http://www.btabdevelopment.com

Reply With Quote
  #3  
Old May 10th, 2013, 04:51 AM
alenmarth alenmarth is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 2 alenmarth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 50 sec
Reputation Power: 0
Export Table data into an Excel SpreadSheet (ACCESS)

To export table data into excel spreadsheet by using desktop application for access.
Take a look Access to Excel Conversion which will help you into exporting access data to excel sheet.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Export Table data into an Excel SpreadSheet (VBA, ACCESS)


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap