W
wpr321
Unregistered / Unconfirmed
GUEST, unregistred user!
ExcelWorkbook1.ConnectTo(ExcelApplication1.ActiveWorkbook);
ExcelWorksheet1.ConnectTo(ExcelWorkbook1.Worksheets[1] as _WorkSheet);
epCount := ExcelWorkbook1.Worksheets.Count;
Temp_Worksheet :=ExcelWorkbook1.Worksheets[1] as _WorkSheet;
//epCount计算出来是等于5的
pCount:=5;
for i := 1 to (pCount - epCount) do
ExcelWorkbook1.Worksheets.Copy(emptyParam, Temp_Worksheet, 1);
我想得到的是从Worksheets[1]拷贝过来四个Worksheets,总共5个
但是实际上得到16个,好象是1,2,4,8,16这样计算出来的,本来我只是想每次拷贝一个Worksheets但是每次都加倍了,应该怎样写啊?
执行
ExcelWorkbook1.Worksheets.Copy(emptyParam, Temp_Worksheet, 1);
ExcelWorkbook1.Worksheets.Copy(emptyParam, Temp_Worksheet, 1);
也会出现4条Worksheets
ExcelWorksheet1.ConnectTo(ExcelWorkbook1.Worksheets[1] as _WorkSheet);
epCount := ExcelWorkbook1.Worksheets.Count;
Temp_Worksheet :=ExcelWorkbook1.Worksheets[1] as _WorkSheet;
//epCount计算出来是等于5的
pCount:=5;
for i := 1 to (pCount - epCount) do
ExcelWorkbook1.Worksheets.Copy(emptyParam, Temp_Worksheet, 1);
我想得到的是从Worksheets[1]拷贝过来四个Worksheets,总共5个
但是实际上得到16个,好象是1,2,4,8,16这样计算出来的,本来我只是想每次拷贝一个Worksheets但是每次都加倍了,应该怎样写啊?
执行
ExcelWorkbook1.Worksheets.Copy(emptyParam, Temp_Worksheet, 1);
ExcelWorkbook1.Worksheets.Copy(emptyParam, Temp_Worksheet, 1);
也会出现4条Worksheets