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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Financial Reporter macro

Status
Not open for further replies.

Toddy2

Technical User
Jan 30, 2003
2
NZ
Hi,

I'm trying to write an ACCPAC VB macro to run an FR excel report. The report that it runs is a standard excel spreadsheet created in FR. However the file produced is a .001 text file...meaning I lose all the formatting.

How can write this code to produce an .xls file with the same format as the original??
 
Write another procedure to rename the file as *.xls and call the procedure straight after the *.001 file has been printed to file by FR. See below (assuming *.001 file has been saved in "C:\clients\temp\")

I wrote this code in excel, so make sure Excel object library is active in Tools / References
Hope this works for you
*************************

Sub moveFile()
Dim dirName As String
Dim oldName As String
Dim newName As String

'set the directory to be checked
dirName = "C:\clients\temp\"
'query for source file in the directory
oldName = Dir(dirName & "quikbal*.*")
oldName = dirName & oldName
newName = "c:\clients\John\sales_John_" & MonthName(Month(Date), True) & Year(Date) & ".xls"
fileCopy oldName, newName
Kill oldName

End Sub
 
Cheers Striderman , right on the money thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top