Hi,
I have the fully qualified filename stored in a string called fname. When I execute the VBA code:
For Each sh In ActiveWorkbook.Worksheets
If sh.Name = "Claims_Detail" Then
sh.Copy
Call formatit
MsgBox Fname
ActiveWorksheet.SaveAs Filename:=Fname, FileFormat:=51
ActiveWorkbook.Close
End If
Next sh
a SaveAs box pops up with book1.xlsx as the name of the file to be saved. My goal was to have no popup and save it in the path and file defined in fname.
What am I missing?
Thanks!
--Ben
ActiveWorksheet.SaveAs should be ActiveWorkbook.SaveAs.
Open in new window