473,411 Members | 1,975 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,411 software developers and data experts.

Choose locations of exported spreadsheets

23
How do you choose what folder you want a transferspreadsheet command to extract into? Can I specifiy a different places for each, right now everything is going into My Documents.
Nov 28 '06 #1
2 1420
Tanis
143 100+
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "YourTableOrQueryName", "PathToWhere.xls", True
Nov 28 '06 #2
NeoPa
32,556 Expert Mod 16PB
See if the following gives you whart you need.
TransferSpreadsheet Method


The TransferSpreadsheet method carries out the TransferSpreadsheet action in Visual Basic. For more information on how the action and its arguments work, see the action topic.

Syntax

DoCmd.TransferSpreadsheet [transfertype][, spreadsheettype], tablename, filename[, hasfieldnames][, range]

The TransferSpreadsheet method has the following arguments.

Argument Description
transfertype One of the following intrinsic constants:
acImport (default)
acExport
acLink
If you leave this argument blank, the default constant (acImport) is assumed.
spreadsheettype One of the following intrinsic constants, or equivalent numeric settings:
0 acSpreadsheetTypeExcel3 (default)
6 acSpreadsheetTypeExcel4
5 acSpreadsheetTypeExcel5
5 acSpreadsheetTypeExcel7
8 acSpreadsheetTypeExcel8
8 acSpreadsheetTypeExcel9
2 acSpreadsheetTypeLotusWK1
3 acSpreadsheetTypeLotusWK3
7 acSpreadsheetTypeLotusWK4
4 acSpreadsheetTypeLotusWJ2 — Japanese version only
Note You can link to data in a Lotus 1-2-3 spreadsheet file, but this data is read-only in Microsoft Access. You can import from and link (read-only) to Lotus .WK4 files, but you can't export Microsoft Access data to this spreadsheet format. Microsoft Access also no longer supports importing, exporting, or linking data from Lotus .WKS or Microsoft Excel version 2.0 spreadsheets by using this method.
If you leave this argument blank, the default constant (acSpreadsheetTypeExcel8) is assumed.
tablename A string expression that's the name of the Microsoft Access table you want to import spreadsheet data into, export spreadsheet data from, or link spreadsheet data to, or the Microsoft Access select query whose results you want to export to a spreadsheet.
filename A string expression that's the file name and path of the spreadsheet you want to import from, export to, or link to.
hasfieldnames Use True (–1) to use the first row of the spreadsheet as field names when importing or linking. Use False (0) to treat the first row of the spreadsheet as normal data. If you leave this argument blank, the default (False) is assumed.
When you export Microsoft Access table or select query data to a spreadsheet, the field names are inserted into the first row of the spreadsheet no matter what you enter for this argument.
range A string expression that's a valid range of cells or the name of a range in the spreadsheet. This argument applies only to importing. Leave this argument blank to import the entire spreadsheet.
When you export to a spreadsheet, you must leave this argument blank. If you enter a range, the export will fail.
Nov 28 '06 #3

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

Similar topics

5
by: Java script Dude | last post by:
For those who are missing the feature on how to import into Open Office dBase app from text files and spreadsheets in OOO Base 2.0: A wizard exists to import from spreadsheets only at this time...
0
by: StepHenHairNet | last post by:
A quick question about the ActiveX Spreadsheet control in Office 2000 Web Components… I’m using these in a VB.net project and wish to do something within a “hidden” OWC Spreadsheet. By...
2
by: Jim S | last post by:
To my surprise and chagrin, newer versions of Access have disabled the functionality that lets users change the data in linked tables that point to a range in an Excel workbook. This is "because of...
2
by: rdemyan via AccessMonster.com | last post by:
I currently have code that brings up a form where the user can see a list of spreadsheets on my ftp site, select one and then download and import the spreadsheet into a table. All of this...
1
by: dsbsnag | last post by:
I am using Access 2003 on Windows XP I'm a school teacher and need help achieving the following: I have three spreadsheets with various information in them. But, they have a common cell named...
0
by: DrewYK | last post by:
I have the project that may never end in front of me. I am creating a routine that will take SpreadSheets from Excel and bring them into Access. I am not using any "DoCmd"s because the goal...
2
by: Cara Murphy | last post by:
Hi There, I am hoping to be able to export a table from Access to Excel, however I would like to be able to select the fields that I want to export... For example, my Table has 23 fields, but...
3
by: Umoja | last post by:
Hi All, This seems like a simple thing, but I can’t seem to figure it out. I am familiar with transferring excel spreadsheets into access using the TransferSpreasheet function...
2
by: BlackEyedPea | last post by:
Hi I have no coding experience but am using access 2003 on XP in the hope that I can find some code that will.... Search a folder in my network & import any excel spreadsheets it finds within...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.