E
EE
Hi
I have a macro that I use to save a sheet as a new file. Now I have a
requirement that it needs to be saved as only XLS and not xlsx. The
macro is used in computers with Excel 2007.
The code snippet is as follows:
************************
Sub ShowCostSheet()
Dim Wb As Workbook
Dim ws As Worksheet
Dim sStr As String
Dim i%, rng As Range
'Set Wb = Workbooks("Pricing Tool.xls")
Set Wb = ActiveWorkbook
Set ws = Worksheets("Cost Calculation Sheet")
'This part saves the workbook in My Documents
sStr = Sheets("Cost Calculation Sheet").Range("COSTCALC") & " - "
& Sheets("Cost Calculation Sheet").Range("D6") & " - " & Format(Date,
" mm-dd-yy")
ws.Copy
ActiveWorkbook.SaveAs sStr
End Sub
*********************
Thanks for your help.
Best
Prasad
I have a macro that I use to save a sheet as a new file. Now I have a
requirement that it needs to be saved as only XLS and not xlsx. The
macro is used in computers with Excel 2007.
The code snippet is as follows:
************************
Sub ShowCostSheet()
Dim Wb As Workbook
Dim ws As Worksheet
Dim sStr As String
Dim i%, rng As Range
'Set Wb = Workbooks("Pricing Tool.xls")
Set Wb = ActiveWorkbook
Set ws = Worksheets("Cost Calculation Sheet")
'This part saves the workbook in My Documents
sStr = Sheets("Cost Calculation Sheet").Range("COSTCALC") & " - "
& Sheets("Cost Calculation Sheet").Range("D6") & " - " & Format(Date,
" mm-dd-yy")
ws.Copy
ActiveWorkbook.SaveAs sStr
End Sub
*********************
Thanks for your help.
Best
Prasad