11-24-2011, 06:11 AM
Hello M/s Priya and Mr. Saini,
I am glad to inform that the script has run successfully. I made a few modifications to the script to add a new sheet each time the script runs.This will save me from the error when k+1 sheet is not present in the workbook. Adding a new worksheet makes my work easy as I can run a macro later to perform same action on all the data.
then rename the sheet to the co_id so that i know which sheet has which company's data and can be easily put into a SPSS file without any error.
This was a huge data collection task and I am thankful to you guys for helping me achieve my goal.
Thanks again.
Solved. This thread stands solved.
I am glad to inform that the script has run successfully. I made a few modifications to the script to add a new sheet each time the script runs.This will save me from the error when k+1 sheet is not present in the workbook. Adding a new worksheet makes my work easy as I can run a macro later to perform same action on all the data.
Code:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook= objExcel.Workbooks.Open("C:\Documents and Settings\Harp\Desktop\Data\ForumExcel.xls")
Set objSheet= objWorkbook.sheets.add
then rename the sheet to the co_id so that i know which sheet has which company's data and can be easily put into a SPSS file without any error.
This was a huge data collection task and I am thankful to you guys for helping me achieve my goal.
Thanks again.
Solved. This thread stands solved.