allen.chengeliang
New Member
- Joined
- Feb 23, 2011
- Messages
- 1
Hi Guys,
I had one issue in copy and saveas menthod, i am trying to copy one worksheet from existing workbook to a new workbook which saved as csv format, the new workbook and the worksheet is created but all records in the old worksheet are NOT being copied over, anyone have idea about this?
Besides, i had one suspect that since i am using company licensed office sw, when the new workbook is saving, workbook calssification windows is prompted out and asking to choose the classification type, could it be a reason also? below is the coding:
Set oWBs = Workbooks
Set oNewWB = oWBs.Add
ThisWorkbook.Worksheets(oWS.Name).Copy oNewWB.Worksheets("Sheet1")
sTableName = UCase(sTablePrefix) & UCase(oWS.Name)
sCSVFileName = sCSVOutputFolder & sTableName & ".csv"
oNewWB.SaveAs sCSVFileName, xlCSV
oNewWB.Close True
Thanks in advance!
Allen
I had one issue in copy and saveas menthod, i am trying to copy one worksheet from existing workbook to a new workbook which saved as csv format, the new workbook and the worksheet is created but all records in the old worksheet are NOT being copied over, anyone have idea about this?
Besides, i had one suspect that since i am using company licensed office sw, when the new workbook is saving, workbook calssification windows is prompted out and asking to choose the classification type, could it be a reason also? below is the coding:
Set oWBs = Workbooks
Set oNewWB = oWBs.Add
ThisWorkbook.Worksheets(oWS.Name).Copy oNewWB.Worksheets("Sheet1")
sTableName = UCase(sTablePrefix) & UCase(oWS.Name)
sCSVFileName = sCSVOutputFolder & sTableName & ".csv"
oNewWB.SaveAs sCSVFileName, xlCSV
oNewWB.Close True
Thanks in advance!
Allen