Output query to excel 08-12-07

Hi,

Can anyone help me with outputing the results of a query to a particular 
  worksheet in an Excel workbook.
Using an "Output To" macro, I've managed to output my query to Excel so 
that it replaces the whole .xls workbook.
But what I need to do is output to Sheet 1 of the .xls workbook and 
leave Sheet 2 intact as it will have formulas referring to Sheet 1.

Thanks

Bob
0
Bob
8/12/2007 11:52:07 AM
access 16762 articles. 3 followers. Follow

1 Replies
736 Views

Similar Articles

[PageSpeed] 35

On Sun, 12 Aug 2007 21:52:07 +1000, Bob wrote:

> Hi,
> 
> Can anyone help me with outputing the results of a query to a particular 
>   worksheet in an Excel workbook.
> Using an "Output To" macro, I've managed to output my query to Excel so 
> that it replaces the whole .xls workbook.
> But what I need to do is output to Sheet 1 of the .xls workbook and 
> leave Sheet 2 intact as it will have formulas referring to Sheet 1.
> 
> Thanks
> 
> Bob

Look up the TransferSpreadsheet method in VBA help.

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"QueryName", "c:\PathToFolder\FileName.xls", True

The above will add a new worksheet to the workbook named "QueryName".
You can use code within the workbook to then copy your data to
whatever sheet you wish, then delete the "QueryName" worksheet.

Change "QueryName" to whatever the actual name of your query is.
-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
0
fredg
8/12/2007 2:17:19 PM
Reply:

Similar Artilces:

Can Excel 2007 link with Outlook 2007
I have a list of companies names that I need to add the addresses to. I don't want them to be on the same worksheet. I will need to add compaines to the list from time to time. Also Is it possible to link these addresses with outlook? Thanks, Dan ...

exit excel within vba
Hello All, I have a vba code, at the end of this code I want to exit excel not close. If I close the excel workbook I can not run excel again from the scheduler. Can anyone provide me help?? thanx all. Murat Demir Hekimoglu You want to quit excel? Application.quit could be what you're looking for. Murat Demir HEKIMOGLU wrote: > > Hello All, > > I have a vba code, at the end of this code I want to exit excel not close. > > If I close the excel workbook I can not run excel again from the scheduler. > > Can anyone provide me help?? > > thanx all....

Excel Bar Graph Questions
I want to compare FY08 & FY09 data (By each mth) using excel bar graph. So, on the X-axis need to show 08 & 09 bar graph in DIFFERENT color. What's the restrictions now I can see is ONLY ONE color shown on data on X axis. Anyone knows how to do it? Many Thanks Hi, Did you move one of the series to the secondary axis? If so see http://peltiertech.com/Excel/Charts/ColumnsOnTwoAxes.html Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Ruby" <Ruby@discussions.microsoft.com> wrote in message news:223C6B4E-345D-40B7-A217-AEA3FA686F...

Excel text box #2
Is there a way to set the default text alignment to "center" for both vertical and horizontal in the draw text box? I am using Excel 2000. I found it for the cell default. That's what I want to do with the draw text box. -- Thanks To get the horizontal centering--just select your text and hit the Center Icon on the format toolbar--just like you would to center text in a cell. I had to hit enter a few times (at the beginning of the text) to center it vertically. rvrl wrote: > > Is there a way to set the default text alignment to "center" for both > ...

Excel missing file
I am a registered user of Office XP Pro. Excel will not start. It is missing a file. In the process of moving, disks in storage. Where can I go online to download the missing file? And, how? ...

Excel integration of models in various workbooks
I have a few different models in seperate excel workbooks ... one for cars, one for houses, one for retirement accounts.. I recently had the idea to take outputs from each of these models and plug them into a single workbook something like life.xls. What I'm wondering is if there is a way to wrap them (the house and car models) with an interface (VBA?) which I can pass parameters and can call from a macro in life.xls to retrieve the output from. Essentially I'd like each of the workbooks (house,..cars) to be like a callable function into which I can pass parameters, and which return...

Modifying Activities associated view 08-25-04
Has anybody tried this unsupported trick in a production environment, or found any problems/issues related to this? Ketil ---------------------------------------------------------------------------------------------------- I've tried this on my test system for the Activities Associated view {00000000-0000-0000-00AA-000010001903}, and it seems to work fine. I can now display and sort by creation date!!! This really solves a major problem with the system and I am keen to try this in my production system. Has anybody used this technique in a production environment yet? Are there any ...

Active X Controls Shrinking on Excel worksheet
I have a workbook and sometimes the ActiveX controls such as listbox, options, checkboxes on the worksheet shrinks or expands while clicking on the controls. Does somebody has experirenced same kind of problem or somebody knows the fix. The only to fix this problem is to restart the machine again. Thanks in advance. ...

Loading MS CRM in FRAME / IFRAME 12-11-06
Is it possible to run MS CRM Forms inside of parent Iframe/Form? How pass to CRM login/password programatically from parent form? Thanks. i believe this is what you're looking for: http://icu-mscrm.blogspot.com/2006/06/showing-associated-activities-in.html unsupported but it works. is_vlb50@hotmail.com wrote: > Is it possible to run MS CRM Forms inside of parent Iframe/Form? > How pass to CRM login/password programatically from parent form? > Thanks. No,I need to display full crm inside my application.And pass login information to crm. Thanks. rvrebel@gmail.com wrote: >...

non linear regression in excel
Hello I have some charts which I am trying to fit lines of best fits to. The general shape of these curves is something representing '4 o' clock' on a clock. I am trying to do non-linear regression to get the closest fit to these curves but the trendline functions on excel are very limited (ie logarthmic,exponential,polynomial etc) and do not produce a sufficient trendline. I was wondering if anyone knows how I could possibly produce the trendline that I require that fits the data on the curve. Many thanks for your help. Warm regards Nikeel - If the general shape is a singl...

excel #13
I need to know if there is a way to put a scroll bar with text, as a pull down menu in a cell. Hi Chelo, Check out Data | Validation | List. HTH -- Regards, Zack Barresse, aka firefytr "Chelo" <Chelo@discussions.microsoft.com> wrote in message news:8BB85A00-4175-47C7-A4EF-52260FD5049A@microsoft.com... >I need to know if there is a way to put a scroll bar with text, as a pull > down menu in a cell. ...

Please help me with my Excel
I have got a new lap top and I have a good antivirus and spyware. my pc works good but once I open Excel my CPU jumps up to %100 and the strange thing is that when I click on other programs my CPU comes back to %4. The more strange thing is that when for example I press F2 to edit a cell , CPU works good but when I press Enter, again it goes back to %100. Here our IT man reinstalled my MS-Office and he did some other exotic operations but there was not any slightest change and the problem is still existing and going on my nerve. Please scientists help me ! I work with Excel 7 hrs per day ...

Query
can excell make a query?please help me Look in Excel's On-line Help for the topic "Importing data with Microsoft Query" rindra99 wrote: > can excell make a query?please help me -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

Signature #12
I am using MS Office XP2003 with Outlook. I am trying unsuccessfully to get my e-mails to include automatically a signature block. I did the following: tools options mail format signatures selected the sigtnature and clicked apply but no siganture appears on the mail. What am I missing? Robert E Fine <refine13@adelphia.net> wrote: > I am using MS Office XP2003 with Outlook. > > I am trying unsuccessfully to get my e-mails to include automatically > a signature block. > > I did the following: > > tools > options > mail format > signatures Just abo...

Excel 2002: Can I save all files by just one click ?
Hi, I have 10 working files in an active window. There is no Save All button under the file menu. May I know if I can save all the files at one click without having to exit excel ? Thanks Low This delivers it in 2 clicks ... Hold down Shift key, click File > Close All Then click "Yes to All" in the ensuing prompt to save changes Success? Celebrate it, hit the YES below -- Max Singapore --- "Mr. Low" wrote: > I have 10 working files in an active window. > There is no Save All button under the file menu. > May I know if I c...

Is there a way to turn off the prompts of a make table query?
I merely want to update the table to be used as an export to Excel using TransferSpreadsheet. Each time it prompts for deleting old records and adding new records. Is there a was to turn off the prompts? Bottom line - I want to create an Macro to export the output of a query to an Excel spreadsheet. BobC, DoCmd.SetWarnings False 'Off Your TransferSpreadsheet line here DoCmd.SetWarnings True 'On -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "...

Dynamic Excel
Dear All Is there anything that I can do in Excel to my Excel report dynamic? For eg... is it possible to create something which will create results based on figures keyed in... ? Any suggestions would be welcomed... It would be good if u could send me similar Excel project of yours... to me as reference... Cheers --- Message posted from http://www.ExcelForum.com/ Hi this is a little bit vague :-) maybe as a starting point: http://www.cpearson.com/excel/pivots.htm http://peltiertech.com/Excel/Pivots/pivotstart.htm http://www.contextures.com/xlPivot02.html http://www.ozgrid.com/Excel/exce...

How do I remove the (blank) from an excel pivot table?
I am trying to create a pivot table from a liston an excel spreadsheet. Many of the items on the list will be blank. On the pivot table, the blank items show up as (blank) - I want the cell to be empty! I tried setting the table empty values but that doesn't work...any help would be greatly apprecated... If you click the small black triangle near the top of the Table, a menu will appear. Just clear the checkbox next to (blank) -- Gary''s Student "MarkfromAZ" wrote: > I am trying to create a pivot table from a liston an excel spreadsheet. Many > of the...

Refreshing a Microsoft Office Excel Chart Object
Can a Microsoft Office Excel Chart Object be refreshed by linking it to an excel spreadsheet? The "chart object" is being copied from the originating excel spreadsheet, using the special past function to make an Excel Chart Object in a Word doc. DonC, Use Paste Special, pasting it as an Excel Chart Object in the Word document. Use the Paste Link button. Now it's linked to the cells of the original worksheet. -- Earl Kiosterud www.smokeylake.com ----------------------------------------------------------------------- "DonC" <don.cook@farmersinsurance.com> w...

Excel 2002 #5
Is there a way to set an excel file to open to the same worksheet regardless to where it was last saved? Trip, In the ThisWorkbook code module, put the following code. Change "Sheet1" to the desired worksheet name. Private Sub Workbook_Open() Worksheets("Sheet1").Select End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Trip Levert" <anonymous@discussions.microsoft.com> wrote in message news:095401c3bdaa$69673f90$a401280a@phx.gbl... > Is there a way to set an excel file to open to the s...

How to convert an excel macro code to a Visual basic program
As it is in the subjec title, this is my question: How to convert an Excel macro code to a Visual Basic program? The fact is I am using some excel macros written for excel 2002 and I want to work with them just like a distinct program. I tried to do it directly, but I faced with lots of errors. Any help would be highly appreciated. ...

If I closed an excel doc without saving can I get it back? thx
I opened up 2 version of excel and tried to close one, I forgot the other was opened and when I chose not to save it I lost my old one also. If there anyway I can get it back? I tried system restore but that was turned off also ;( Thx for any help! If that file was originally out on the drive, then you should be able to just open it up and have the pre-changes-made version of it available. However, if you were creating it from scratch and closed without saving it, then it is gone. System Restore would never help in a case like this - System Restore does not save user data; it is a...

Form Queries
I have a form [View Grievance Reports] with several reports set to run by a single macro [View Grievance Reports Macros]. The form [View Grievance Reports] has an unbounded list box that uses a table [Grievance Reports Table] as the row source type. The report based macro works perfectly. I’m now trying to adapt this form and macro to open a specific query when I either click or double click on the query listed on the form. I can get the Query based macro to work if I enter each query for click and double click. If a query is listed on the form and it is not entered in the macro the q...

Manually Uninstalling Excel Viewer
HELP! I need to manually uninstall my corrupt Excel viewer. Would somebody offer some details as to this task? Thank you. I've never installed nor uninstalled Excel Viewer, but the standard procedure for uninstalling a program is to: Close Excel Viewer Click Start Select Control Panel Find and double-click on "Add or Remove..." Find Excel Viewer in the list of programs. Click on Remove. Follow screen instructions. HTH Otto "Steve Evans" <sjevans2@ameritech.net> wrote in message news:uXSilFs3DHA.1924@TK2MSFTNGP10.phx.gbl... > HELP! > > I need to ma...

List of where queries are used?
I have an access database which has many queries which are leftover from various tests and temporary data extract needs. Is there a tool which can tell me which queries are used in all reports, queries, macros, or modules in the database? Hi Joseph, You might want to take a look at the Total Access Analyzer (< http://www.fmsinc.com/MicrosoftAccess/BestPractices.html>). Or you can use Access's own Documenter. Run it on all the objects in Access with maximum reporting settings, and then export/save it to a file of some sort that can be searched (text, PDF, Wo...