473,378 Members | 1,498 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,378 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 31870
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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
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...
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...

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.