Can someone please help me with the following code:
Dim NewOutputFile As Workbook
Set NewOutputFile = Workbooks.Add(FileName & ".xls")
where FileName = "C:\Documents and Settings\me\My Documents\file.xls"
I want to create a new workbook dynamically and then add new tabs:
NewOutputFile.Sheets.Add ("New tab")
EDIT when I say "workbook" I mean a new excel file
FileName = "C:\Documents and Settings\me\My Documents\file.xls"
, thenWorkbooks.Add(FileName & ".xls")
will beWorkbooks.Add("C:\Documents and Settings\me\My Documents\file.xls.xls")