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

Export a query to Excel

Dear reader,

With the export command you can export a query to Excel.

By activate this command a form pop's up with the following text:

"The database object "Name.." already exist. Do you want to replace the
existing database object with the one you are exporting? If you want to
export this object without replacing the existing database object, click no.
You can then export the object again and rename it in the export dialog
box."

In case selecting [Yes] the Excel sheet with the same name will be replaced
and the other sheets in the Excel file remains unchanged. And this is watt I
want.

If I do the same with the following code:

DoCmd.OpenQuery "QueryName.."

DoCmd.RunCommand acCmdOutputToExcel

There is no warning that the Excel file exists and will be overwrite.

Is there code available with is doing the same as the "Export" command, only
replacing the Excel sheet with the same name as the query.

Thanks for any help.

Kind regards,

Simon
Feb 11 '07 #1
5 31874
Simon wrote:
Dear reader,

With the export command you can export a query to Excel.

By activate this command a form pop's up with the following text:

"The database object "Name.." already exist. Do you want to replace the
existing database object with the one you are exporting? If you want to
export this object without replacing the existing database object, click no.
You can then export the object again and rename it in the export dialog
box."

In case selecting [Yes] the Excel sheet with the same name will be replaced
and the other sheets in the Excel file remains unchanged. And this is watt I
want.

If I do the same with the following code:

DoCmd.OpenQuery "QueryName.."

DoCmd.RunCommand acCmdOutputToExcel

There is no warning that the Excel file exists and will be overwrite.

Is there code available with is doing the same as the "Export" command, only
replacing the Excel sheet with the same name as the query.

Thanks for any help.

Kind regards,

Simon

Don't know. But perhaps you could try TransferSpreadsheet instead.

Enter
TransferSpreadsheet
in a code module, highlight it, and press F1.

Feb 11 '07 #2
TransferSpreadsheet is for import (Excel to Access) I am looking for export
(Access to Excel)

"salad" <oi*@vinegar.comschreef in bericht
news:j6**************@newsread3.news.pas.earthlink .net...
Simon wrote:
Dear reader,

With the export command you can export a query to Excel.

By activate this command a form pop's up with the following text:

"The database object "Name.." already exist. Do you want to replace the
existing database object with the one you are exporting? If you want to
export this object without replacing the existing database object, click
no.
You can then export the object again and rename it in the export dialog
box."

In case selecting [Yes] the Excel sheet with the same name will be
replaced
and the other sheets in the Excel file remains unchanged. And this is
watt I
want.

If I do the same with the following code:

DoCmd.OpenQuery "QueryName.."

DoCmd.RunCommand acCmdOutputToExcel

There is no warning that the Excel file exists and will be overwrite.

Is there code available with is doing the same as the "Export" command,
only
replacing the Excel sheet with the same name as the query.

Thanks for any help.

Kind regards,

Simon
Don't know. But perhaps you could try TransferSpreadsheet instead.

Enter
TransferSpreadsheet
in a code module, highlight it, and press F1.

Feb 12 '07 #3

"Simon" <Sv********@Versatel.nlwrote in message
news:45***********************@news.tele2.nl...
Dear reader,

With the export command you can export a query to Excel.

By activate this command a form pop's up with the following text:

"The database object "Name.." already exist. Do you want to replace the
existing database object with the one you are exporting? If you want to
export this object without replacing the existing database object, click
no.
You can then export the object again and rename it in the export dialog
box."

In case selecting [Yes] the Excel sheet with the same name will be
replaced
and the other sheets in the Excel file remains unchanged. And this is watt
I
want.

If I do the same with the following code:

DoCmd.OpenQuery "QueryName.."

DoCmd.RunCommand acCmdOutputToExcel

There is no warning that the Excel file exists and will be overwrite.

Is there code available with is doing the same as the "Export" command,
only
replacing the Excel sheet with the same name as the query.

Thanks for any help.

Kind regards,

Simon

You mention about replacing the Excel sheet. Are you talking about the
worksheet (e.g. Sheet1, Sheet2 etc) or do you mean the Excel workbook (e.g.
C:\test\Book1.xls)?

If you mean you want to check if the workbook exists and prompt to replace
it, check out the "Dir" function in the VBA help file and write some code
using this function to check if the files exists.

You also replied to Salad that TransferSpreadsheet is for importing. I also
ask you to check the VBA help file for this command.

Jeff
Feb 12 '07 #4
Simon wrote:
TransferSpreadsheet is for import (Excel to Access) I am looking for export
(Access to Excel)
That's new to me. You should be able to import, link, or export.
>
"salad" <oi*@vinegar.comschreef in bericht
news:j6**************@newsread3.news.pas.earthlink .net...
>>Simon wrote:

>>Dear reader,

With the export command you can export a query to Excel.

By activate this command a form pop's up with the following text:

"The database object "Name.." already exist. Do you want to replace the
existing database object with the one you are exporting? If you want to
export this object without replacing the existing database object, click

no.
>>>You can then export the object again and rename it in the export dialog
box."

In case selecting [Yes] the Excel sheet with the same name will be

replaced
>>>and the other sheets in the Excel file remains unchanged. And this is

watt I
>>>want.

If I do the same with the following code:

DoCmd.OpenQuery "QueryName.."

DoCmd.RunCommand acCmdOutputToExcel

There is no warning that the Excel file exists and will be overwrite.

Is there code available with is doing the same as the "Export" command,

only
>>>replacing the Excel sheet with the same name as the query.

Thanks for any help.

Kind regards,

Simon


Don't know. But perhaps you could try TransferSpreadsheet instead.

Enter
TransferSpreadsheet
in a code module, highlight it, and press F1.


Feb 12 '07 #5
Transferspreadsheet goes both ways.
"Simon" <Sv********@Versatel.nlwrote in message
news:45***********************@news.tele2.nl...
TransferSpreadsheet is for import (Excel to Access) I am looking for
export
(Access to Excel)

"salad" <oi*@vinegar.comschreef in bericht
news:j6**************@newsread3.news.pas.earthlink .net...
>Simon wrote:
Dear reader,

With the export command you can export a query to Excel.

By activate this command a form pop's up with the following text:

"The database object "Name.." already exist. Do you want to replace the
existing database object with the one you are exporting? If you want to
export this object without replacing the existing database object,
click
no.
You can then export the object again and rename it in the export dialog
box."

In case selecting [Yes] the Excel sheet with the same name will be
replaced
and the other sheets in the Excel file remains unchanged. And this is
watt I
want.

If I do the same with the following code:

DoCmd.OpenQuery "QueryName.."

DoCmd.RunCommand acCmdOutputToExcel

There is no warning that the Excel file exists and will be overwrite.

Is there code available with is doing the same as the "Export" command,
only
replacing the Excel sheet with the same name as the query.

Thanks for any help.

Kind regards,

Simon

Don't know. But perhaps you could try TransferSpreadsheet instead.

Enter
TransferSpreadsheet
in a code module, highlight it, and press F1.


Feb 13 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: AHIhelp | last post by:
I have a .Net report that has several parameters that go into it. When the report is run and I try to right-click and use the built in Export to Excel function in IE 6 - it opens up excel and...
6
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel...
8
by: DC Gringo | last post by:
I have a simple button that should open another window and export a datagrid to an Excel file. I'm getting: "Name 'window' is not declared." What do I need to declare or import? <INPUT...
13
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"...
1
by: JawzX01 | last post by:
Hello All, First, thank you for any help you can provide. I'm trying to do a simple export to excel. I've used the classic code that is all over the internet, and of course it worked without a...
3
by: yovation | last post by:
Hi, I have a 3 table database. 1 parent 1 child 1 child of child I would like to get the data into excel as 1 sheet (similar to a grouped report).
1
by: bmcgeoch | last post by:
To preface this post, I personally did not create the database in question. It was created by someone working for our technical support provider. That person has since left the company and is not...
2
by: Access user | last post by:
My apologies for crossposting this, but I did not get any response in microsoft.public.access ...
2
by: jatin32 | last post by:
Hi, I have to export query result to EXCEL file in certain location. how do I do that? I have used DoCmd.OutputTo acOutputQuery, stDocName, acFormatXLS, , , , , acExportQualityScreen
4
by: Tennotrumps | last post by:
I am trying to export a report to excel but the "excel" option is greyed out. I can export the query the report is based on, but not the report. However, if I open the database on another PC I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.