Hi Guys,
I have this workbook with multiple worksheets, and after writing each worksheet I am copying that worksheet into its own file by itself. So I have 1 workbook with 20 sheets + 20 workbooks of 1 sheet each. After writing all worksheets, i open them all up one by one (only the ones with 1 sheet) to delete a couple of columns in each of these files. I am not deleting the columns while writing initially, because i want the 2 columns in the ALL workbook (the one with 20 sheets), but dont want them in the 20 other workbooks. But when i open an xlsx file and call DeleteColumn method, i get an 'Invalid Column Name' error. I havent been able to figure this out or how to fix this. Please help me.
Thanks,
Sreejith
Hi,
Please try our latest version 7.0.3:
If you still find the issue, kindly create a simple console demo application with v7.0.3, zip it and post it here, we will check your issue soon.
Thank you.
Thank you Amjad for the quick response. I installed v7.0.3, but i still get that issue. The skeleton of the code is like this -
Xcel.OpenTemplate("Sheet1") 'Open blank worksheet
Xcel.WriteIntoCell("A1 to H1") 'Write values into blanksheet. 'If i do Xcel.DeleteColumn(2) here, it works, but doesnt work below.
Xcel.CopySheetToNewWorkBook(strNewFileName) 'Copy this sheet to a new workbook (this saves to a new file)
Xcel.ProtectWorkSheet()
Xcel.SaveWorkSheet(strOrigFileName) 'Save original workbook
Xcel = nothing
Then later,
Xcel.OpenTemplate (strNewFileName) 'Open copied workbook
Xcel.DeleteColumn(2) 'Delete column 2 in active sheet -> This is where i get the error
Xcel.ProtectWorkSheet()
Xcel.SaveWorkSheet(strNewFileName) 'Save back this workbook
Xcel = nothing
Will this be sufficient or do you want me to still attach a demo project?
Thanks,
Sreejith
Hi,
It will be good if you could create a sample console application, zip it and post it here so that we could check the issue thoroughly.
Thank you.