mikeprice53
Active Member
- Joined
- Jan 21, 2003
- Messages
- 297
Please refer to the VBA below
my problem is that when it opens up another workbook to paste the data into it opens up two and does what it is supposed to to the second one but leaves teh first one open, all I want is the one workbook to save and close as stated in teh code !
Please help
Dim NewWb As Workbook
t = Time
d = Date
If Chk_Save2File = True Then
Set NewWB = Workbooks.Add
NewWB.Activate
Windows("Import Calculator 20").Activate
Sheets("PRINTOFFSHEETAFTBP").Select
Sheets("PRINTOFFSHEETAFTBP").Copy
ChDir "G:\"
ActiveWorkbook.SaveAs Filename:="G:\FAMALBUM\Imports Calculator\Saved Results\" & Cusn & "-" & "AftBP" & "-" & Format(d, "ddmmmyy") & "@" & Format(t, "hh-mm") & ".xls", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
Range("B9").Select
End If
my problem is that when it opens up another workbook to paste the data into it opens up two and does what it is supposed to to the second one but leaves teh first one open, all I want is the one workbook to save and close as stated in teh code !
Please help