Djblois
12-16-2009, 02:04 PM
I can't seem to figure out something so simple as creating a copy of a workbook. I can copy a worksheet into a new workbook but not a whole workbook. Here is the code I am using:
If frmEmailWork.cbSendInOldFormat And Not Right(wbWorking.Name, 4) = ".xls" Then
filename = wbWorking.Name
Pos = InStrRev(filename, ".")
If Pos > 0 Then
filename = Left$(filename, Pos - 1)
End If
wbWorking.SaveAs "H:\" & Application.UserName & "\" & filename & ".xls", FileFormat:=xlNormal
End If
Set wbTemp = ActiveWorkbook
but I do not want it to save the current workbook as a new name - I want it to create a copy of the whole workbook then do a save as.
If frmEmailWork.cbSendInOldFormat And Not Right(wbWorking.Name, 4) = ".xls" Then
filename = wbWorking.Name
Pos = InStrRev(filename, ".")
If Pos > 0 Then
filename = Left$(filename, Pos - 1)
End If
wbWorking.SaveAs "H:\" & Application.UserName & "\" & filename & ".xls", FileFormat:=xlNormal
End If
Set wbTemp = ActiveWorkbook
but I do not want it to save the current workbook as a new name - I want it to create a copy of the whole workbook then do a save as.