Copying Worksheet to another Workbook without linking


2004-08-10 12:12:02 AM
cppbuilder96
Hi,
I'm using BCB6 and including Excel_2k.
I need to be able to copy a worksheet from one workbook to another without the links to the original notebook showing
up. I can successfully copy the worksheet to the other workbook, but when a cell has a formula like '=Sheet1'!A2 in the
orginal worksheet, it shows up as '=path_to_old_file\[oldfile]Sheet1'!A2. Is there any to copy it in such a way that it copies
the formulas exactly?
This code successfully copies the worksheet
tSheetOld->Copy(TNoParam(), vSheet);
where tSheetOld is a TExcelWorksheet (from the old workbook) and vSheet is a VARIANT that holds the sheet in the new
workbook where the sheet should be placed after.
The signature of Copy is:
Copy(Before Sheet, After Sheet)
Thanks,
Matt