Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / March 2004

Tip: Looking for answers? Try searching our database.

Export data to excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Luigi Galdi - 23 Mar 2004 12:57 GMT
I have a macro that it exports the data in file .xls, as
i can visualize  the file automatically after that its
creation
Bryan Reich [MSFT] - 30 Mar 2004 01:13 GMT
You can always use the Shell() function to run Excel and open the document.
You can also create an Excel object in VBA code, but for this purpose, Shell
might be easier.

ex.
public sub OpenExcelFile( filename As String )
   Shell("excel.exe """ & filename & """")
end sub

And in your macro make the line after your export a RunCode macro, running
the OpenExcelFile subroutine. If there is no need to generate the file name
(it's constant), then you could also do all this without the subroutine by
making the RunCode line in the macro a RunApp macro instead, with the
command line property
   excel.exe "<filename with path>"
--
Bryan Reich
Microsoft Office
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> I have a macro that it exports the data in file .xls, as
> i can visualize  the file automatically after that its
> creation
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.