473,545 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Vb code for Exporting Access table to Excel

21 New Member
Hello All,
I'm looking for the vb code that export an access table to specific worksheet in Excel. I tried to search see if this question was answered before here, but didn't find anything that really relates to this question.

I will appreciate your help,

thanks in advance.
Aug 20 '10 #1
3 3490
NeoPa
32,563 Recognized Expert Moderator MVP
Sarah,

We don't generally work that way. We are happy to help you, and lead you to a certain extent, but we draw the line at simply providing boiler-plate code on request.

If you would like to share what you've already tried and possibly ask a specific question related to where you're stuck then we can help further.

I can tell you that using the following requires the table or QueryDef object being exported to have the same name as the worksheet you want to export it into :
Expand|Select|Wrap|Line Numbers
  1. DoCmd.TransferSpreadsheet()
The TableName parameter would be the important one here.
Aug 20 '10 #2
sarah2855
21 New Member
Thanks Neopa,

Yes I'm using DoCmd.TransferS preadsheet() .Sorry I wasn't so clear in my question. My problem was when using TransferSpreads heet() after I open up the excel file I get error message because of the file type. The code I was using is:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "TABLE NAME", "FILE PATH", True, "WorkSheet Name"
After I did a little bit of search , I figured I have to change acSpreadsheetTy peExcel12 to acSpreadsheetTy peExcel12Xml to create *.xlsx file type.

Thanks for your reply,
Sarah
Aug 20 '10 #3
NeoPa
32,563 Recognized Expert Moderator MVP
Good work Sarah :)

I'm still using 2003 so know very little about 2007 specific facilities, as this would seem to be.
Aug 20 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
5130
by: Keon | last post by:
Hoi, I'm using a database with alot of records in 1 table (more than 3000). If i want to export this table to excel i only get it till record 2385. Do someone know how i can solve this probleme? To export my tables i use folowing code: StTotaal = stLocatieName & "\Archief\" & Year(Date) & Month(Date) & Day(Date) & "_Gegevens.xls" ...
5
4331
by: premmehrotra | last post by:
I am using Microsoft Access 2000 and Oracle 9.2.0.5 on Windows 2000. When I export a table from Access to Oracle using ODBC I get error: ORA 972 identifier too long I think the error is because one or more columns in Access table are longer than 30 characters. My question is how one can overcome this problem. I also see several column...
3
4059
by: premmehrotra | last post by:
I am using Access 2000 and Oracle 9.2.0.x on a Windows 2000. I have setup Oracle 9.2 ODBC Driver (I have not yet figured how to set Microsoft's Oracle ODBC driver). I am exporting a table from Access to Oracle and I get following error: ODBC Call Failed: ORA-12571: TNS Packet Failure Error I see table and its indexes created in Oracle....
1
1707
by: setterst | last post by:
I am quite new to VBA and Access, but I am trying to figure out how to export specific values from a table in Access, so I can save it in a given cell in Excel. I have been able to figure out how to open and modify cells in my spreadsheet, but I don't understand how to select elements of the Access table to export it to Excel. Here is what I...
1
1823
by: CLarkou | last post by:
I developed a program in Access. Then I developed add-ins in Excel & Power Point with common modules from Access database. What is the solution for not having to copy+paste code from Access to Excel & Power Point ? Can I have my code in a common file and call it from all 3 programs ?
1
3004
by: Korvath | last post by:
I am trying to export an Access table with ~118,000 records to Paradox 4.5. I am receiving an error message Reserved Error (-5016). This error has no description, so I am at a loss to fix this problem. This is an issue we have never had before. Has anyone seen this before and is there a fix or workaround? Thanks.
4
8165
by: raju5725 | last post by:
have a MS access table and I want to export it to comma delimited text file. How do I do this programmatically using VB.NET or C#? Thanks for any help in advance. Raju
0
1200
by: Dlangdaman | last post by:
What I am trying to do ...I have a program that keeps the names, numbers, blah blah of customers....this is gui and saves to access. I need a button with code with the capability to export the access info to excel, PDF, Txt...any of the above. but I would like it to be exported in a printable readable manner...i can get it to go to notepad..but in...
8
11069
by: Irene | last post by:
Hi, I have an MS Access Database with 1 Table containing about 2 million records in Unicode (diferent languages). I would like to export the Table to a Text file (CSV, Tab, etc.) Access dows only export about 65,000 at 1 time. Almost an imposible job.
1
2541
by: JFKJr | last post by:
Hi! I have exported an access table data into an excel file using the following code. However, the code exported all the data to the excel sheet starting from 'A' cell (first column). But I want to export all the data into the excel starting from cell B (second column) and include the heading "Extract Policy" followed by checkboxes in 'A' cell. ...
0
7409
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7918
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5981
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5341
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4958
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1897
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1022
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
715
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.