473,387 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Vb code for Exporting Access table to Excel

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 3482
NeoPa
32,556 Expert Mod 16PB
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
Thanks Neopa,

Yes I'm using DoCmd.TransferSpreadsheet() .Sorry I wasn't so clear in my question. My problem was when using TransferSpreadsheet() 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 acSpreadsheetTypeExcel12 to acSpreadsheetTypeExcel12Xml to create *.xlsx file type.

Thanks for your reply,
Sarah
Aug 20 '10 #3
NeoPa
32,556 Expert Mod 16PB
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
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...
5
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...
3
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...
1
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...
1
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...
1
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...
4
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
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...
8
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...
1
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.