With my limited skills I was able to come up with the following code:
each of the cbo
[*] and Box
[*] values are from comboboxes and disabled textboxes from a form in the same wb - it works perfect from a workbook saved as xl2007 file. So what it does is to take sheet (cboRptname.Value) to a separate wb and then save it as xls file.
But when I try to open the file, it tells that the file contains a different file extension than the actual file format. And is true, because after it tell me that and allows (on the same xl2007 version) to open the file, I can see that it has 1 mil+ rows, so it is not an xls file.
What can I do in that case guys?
Thanks,
Ron
Code:
Private Sub SaveWS()
Dim wb As Workbook
ActiveWorkbook.Worksheets(cboRptname.Value).Copy
Set wb = ActiveWorkbook
wb.SaveAs Filename:="\\Treasury\Accounts\CNDL\" & cboYear.Value & "\" & BoxQtr.Value & "\Portfolios\" & _
BoxMonthText.Value & "\" & cboRptname.Value & " " & cboYear.Value & cboMonth.Value & cboDay.Value & ".xls"
wb.Close
End Sub
[*] and Box
[*] values are from comboboxes and disabled textboxes from a form in the same wb - it works perfect from a workbook saved as xl2007 file. So what it does is to take sheet (cboRptname.Value) to a separate wb and then save it as xls file.
But when I try to open the file, it tells that the file contains a different file extension than the actual file format. And is true, because after it tell me that and allows (on the same xl2007 version) to open the file, I can see that it has 1 mil+ rows, so it is not an xls file.
What can I do in that case guys?
Thanks,
Ron