Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Big Time Help...

Status
Not open for further replies.

daniribs7

Technical User
Aug 13, 2003
17
0
0
ZA
Can't get this to work, could somebody please help me out, to export my report out as an excel file from the Macro:

Sub BANCO_AUSTRAL()

Dim Doc As Document
Dim Rep As Report
Application.Documents.Open ("c:\BalancsvSheet.rep")
Application.Documents.Open("c:\BalancsvSheet.rep").Application.Documents.Open("c:\BalancsvSheet.rep").Reports.Item("c:\BalancsvSheet.rep").ExportAsText ("C:\TEMP\Test" + ".xls")
Application.Documents.Open("c:\BalancsvSheet.rep").Close

MsgBox ("COMPLETE. THANK YOU")
End Sub
 
Does anybody know how to solve this?

I need a solution to this ASAP.
 
I really don't understand your coding as to what it is doing. But in a nutshell if you want to export a report to excel with the formating then it is a big working. But with ExportAsText what you are doing is exporting the report as a text file but only thing here is the file extension will be xls. Have a look at the coding below.

Code:
Sub Test()
ActiveDocument.ActiveReport.ExportAsText ("C:\\Test.xls")
End Sub

Call this macro and it will export the current report to XLS file. No need for you to open the report explicitly.

Good Luck
Sri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top