ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy the results of an Access query into an Excel spreadsheet (https://www.excelbanter.com/excel-programming/305005-copy-results-access-query-into-excel-spreadsheet.html)

lylo

Copy the results of an Access query into an Excel spreadsheet
 
Hi,

I have a macro in excel, and I would like to add a sub that would
- open Access
- Copy the results of a query into a new spreadsheet of my workbook
- close Access

Thanks

lylo

Ken Wright

Copy the results of an Access query into an Excel spreadsheet
 
Have you tried just using the Data / Import External data option which will
allow you to query Access? Recording the macro will give you the syntax, you
can query as you would in Access and you won't even need to open Access, and you
can then choose to return the results to a sheet in your Excel workbook.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"lylo" wrote in message
om...
Hi,

I have a macro in excel, and I would like to add a sub that would
- open Access
- Copy the results of a query into a new spreadsheet of my workbook
- close Access

Thanks

lylo



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 22/07/2004



lylo

Copy the results of an Access query into an Excel spreadsheet
 
Hi !

Yes, it's working thanks a lot. I don't even need to write a macro as
the table would refresh each time the worksheet is opened !

Cheers

lylo



"Ken Wright" wrote in message ...
Have you tried just using the Data / Import External data option which will
allow you to query Access? Recording the macro will give you the syntax, you
can query as you would in Access and you won't even need to open Access, and you
can then choose to return the results to a sheet in your Excel workbook.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"lylo" wrote in message
om...
Hi,

I have a macro in excel, and I would like to add a sub that would
- open Access
- Copy the results of a query into a new spreadsheet of my workbook
- close Access

Thanks

lylo



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 22/07/2004


Ken Wright

Copy the results of an Access query into an Excel spreadsheet
 
You're welcome :-)

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------


<snip


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.727 / Virus Database: 482 - Release Date: 26/07/2004




All times are GMT +1. The time now is 01:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com