473,769 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Running a Macro for exporting to Excel

7 New Member
I have created four query that gives four different output. Then I have created four macros from that query to export that reports to excel and it is giving four different excel file. Is it possible to make a macro that will give four excel output on four different sheets of a single excel file ?
Jul 12 '07 #1
3 1609
JConsulting
603 Recognized Expert Contributor
I have created four query that gives four different output. Then I have created four macros from that query to export that reports to excel and it is giving four different excel file. Is it possible to make a macro that will give four excel output on four different sheets of a single excel file ?

Inside your macro, repeat the transferspreads heet command for each query. Change the "Range" option to be the name of the sheet you want to create for each one.

There is also the option to create a coded solution, which would also use the transferspreads heet method and loop through the names of your queries.

J
Jul 12 '07 #2
Hiranmoy
7 New Member
Inside your macro, repeat the transferspreads heet command for each query. Change the "Range" option to be the name of the sheet you want to create for each one.

There is also the option to create a coded solution, which would also use the transferspreads heet method and loop through the names of your queries.

J
In Macro,when I select 'output to' action, 'Range' option is not present.


Transferspreads heet command is for select that sheet from where it picks the data and create a table with a specified name.


But my question is how i can run four query at a time and which give an output in four different sheets of a single excel file with a macro


(e.g. the excel file name will be 'Sale' and the four sheets in the excel file will be East,West,North ,South)
Jul 13 '07 #3
JConsulting
603 Recognized Expert Contributor
In Macro,when I select 'output to' action, 'Range' option is not present.


Transferspreads heet command is for select that sheet from where it picks the data and create a table with a specified name.


But my question is how i can run four query at a time and which give an output in four different sheets of a single excel file with a macro


(e.g. the excel file name will be 'Sale' and the four sheets in the excel file will be East,West,North ,South)
you're using the wrong action in your macro. Use the TransferSpreads heet Action as I posted before.
J
Jul 13 '07 #4

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

Similar topics

1
1769
by: Sylvia | last post by:
Dear All, Would appreciate if someone can help me out on this. I have an Excel Add-in which is only available on the web server. The Add-in allows user to retrieve data from a proprietary database. I have configured an Excel workbook to retrieve the data via the Add-in base on some inputs that the user enter in some cells (B7 and B8) in sheet1.
3
9248
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works only exporting to single worksheet. but i need to export data to multiple worksheets. it is very urgent to us. so please help me in code.
0
2034
by: Onlyeyes | last post by:
I have a TransferSpreadsheet action in my macro where I want to export the results of a select query into excel 10 named "Query1". I type in the name of the query into the "table name" field and I type the file name of the excel spreadsheet into the file name field. However, when the macro runs, I get an error that the database engine can not find the object "Query1". What I am I doing wrong here? I know that a select query can be...
6
9862
by: geronimo_me | last post by:
Hi, I am trying to run an Excel macro from an Access module, however when I run the code the macro runs but then I get an error in Access. The error is: Run-time error "440", Automation error. My code is: Sub Run_Excel_Macro() Dim xls, xlWB As Object
1
3167
by: Mustufa Baig | last post by:
I have an ASP.NET website where I am showing off crystal reports to users by exporting them to pdf format. Following is the code: ---------------- 1 Private Sub ExportReport() 2 Dim oStream As System.IO.MemoryStream = 3 myReport.ExportToStream( ExportFormatType.PortableDocFormat) 4 Response.Clear() 5 Response.Buffer() = True
2
3184
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to set this up so as to do it reliably and minimize overhead? There are currently no constraints on the destination table. Assume the user or some configuration specifies the database name, server name, and filename+fullpath. The server is SQL...
2
4477
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I exported a gridview to excel spreadsheet. I want to adjust the column width of the excel spreadsheet. Is it possible to create Excel macro from C# to adjust the column width of the spreadsheet. Below is my code for exporting to excel string attachment = "attachment; filename=Contacts.xls"; Response.ClearContent();
1
2767
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I exported a gridview to excel spreadsheet. I want to adjust the column width of the excel spreadsheet. Is it possible to create Excel macro from C# to adjust the column width of the spreadsheet. Below is my code for exporting to excel string attachment = "attachment; filename=Contacts.xls"; Response.ClearContent();
11
1931
by: rccoburn | last post by:
I have a database that has thousands of customer records. Right now I use a macro that prompts the user for the customer registration number and then exports the record to excel. It prompts the user prior to exporting every year. Is there any way to prompt the user once for the registration number then store the value in a variable that is reference in the criteria of the queries so it consecutively exports the records to excel. I want...
0
9423
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9860
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6668
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3955
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
2
3560
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.