problem with macros using Excel 2007

  • Thread starter David Nicholson
  • Start date
D

David Nicholson

I have the following macro that was created under old excel and now that we
are on Excel 2007 it is no longer working. The workbook contains two sheets
that are hidden. It seems that the macro is grabbing the last sheet and
saving it as CSV instead of the one being activated.

Sub CreateOutputFile()

' Macro created 8/29/2002 by Del Evans

Application.StatusBar = "Creating Output Files, Please Wait . . ."
Application.ScreenUpdating = False

On Error GoTo 0
'Save the Treasury Spreadsheet
ThisWorkbook.Worksheets("Treasury Work Area").Activate
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\All Users\Documents\Treasury ARE
Worksheet.xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False


On Error GoTo 0
'Create the CSV file for the SAP BW Upload
ThisWorkbook.Worksheets("Upload Data").Activate
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\All Users\Documents\AREEXCTR.csv",
FileFormat:= _
xlCSV, CreateBackup:=False

Application.StatusBar = "Output Files Created"
Call MsgBox("Output Files Created", vbOKOnly, "Done!")
Application.StatusBar = False

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top