-
-
Notifications
You must be signed in to change notification settings - Fork 69
Description
There's no function to copy external link, so after clone a sheet and save to another workbook, when you open it, Excel will report error and ask if you want to fix the error, if yes, the formula with external link will be removed.
Code:
let input_file = "../excel/test_external_link.xlsx"; let from_book = umya_spreadsheet::reader::xlsx::read(input_file).unwrap(); let from_sheet = from_book.get_sheet_by_name("Sheet1").unwrap(); let mut to_book = umya_spreadsheet::new_file_empty_worksheet(); let to_sheet = from_sheet.clone(); let _ = to_book.add_sheet(to_sheet).expect("error when add_sheet"); let out_file = PathBuf::from("../excel/test_external_link_clone.xlsx"); if out_file.exists() { let _ = std::fs::remove_file(&out_file).expect("error when remove_file"); } let _ = umya_spreadsheet::writer::xlsx::write(&to_book, &out_file).expect("error when write");
File