Hey guys,
I am running this code in my app to insert another worksheet into workbook:
Set ExcelWS = ExcelWB.worksheets.Add
ExcelWS.Name = "Created on " & Format(Now, "MMM-d" & " at " & Format(Now, "H-mm"
The name part is supposed to give it somewhat unique name, so if the user runs it repeatevly at least they are different in the workbook.
My problem is that whenever I add the worksheet this way, it gets inserted at the [number of default sheets in excel workbook] + 1 position, which is ok with me, and every other time I insert into this workbook, it replaces the previously inserted one. For the purpose of my app it is crucial that all the worksheets stay in the same workboook. Is there any way to add the worksheet without replacing the previously inserted one?
Thank you all for your help
vlada
I am running this code in my app to insert another worksheet into workbook:
Set ExcelWS = ExcelWB.worksheets.Add
ExcelWS.Name = "Created on " & Format(Now, "MMM-d" & " at " & Format(Now, "H-mm"
The name part is supposed to give it somewhat unique name, so if the user runs it repeatevly at least they are different in the workbook.
My problem is that whenever I add the worksheet this way, it gets inserted at the [number of default sheets in excel workbook] + 1 position, which is ok with me, and every other time I insert into this workbook, it replaces the previously inserted one. For the purpose of my app it is crucial that all the worksheets stay in the same workboook. Is there any way to add the worksheet without replacing the previously inserted one?
Thank you all for your help
vlada