Export data to excel

  • Thread starter Thread starter Luigi Galdi
  • Start date Start date
L

Luigi Galdi

I have a macro that it exports the data in file .xls, as
i can visualize the file automatically after that its
creation
 
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>"
 
Back
Top