catalincirjan
New Member
- Joined
- Aug 28, 2020
- Messages
- 18
- Office Version
- 2016
- Platform
- Windows
Hello,
On a sharepoint excel I have used the record option to create small script that will copy the content of a specific sheet -> create a new one -> paste -> rename the sheet
On the online version, only Office Scrips work. Even if I upload a file that has a VBA macro, once uploaded it 'dissapears'.
I have tried to make the renaming of the sheet dinamically, the name being the date ( "December 9th" would have been ideal, but any format is better then none). No success so for.
Can anybody make any suggestions, please? Currently it just puts the string 'denumire' in there
----------------------------------------------------------------------------------------------------------------------------
function main(workbook: ExcelScript.Workbook) {
// Add a new worksheet
let sheet1 = workbook.addWorksheet();
let tracks = workbook.getWorksheet("Tracks");
// Paste range at Sheet1!A1 from Tracks!1:1048576
sheet1.getRange("A1")
.copyFrom(tracks.getRange("1:1048576"), ExcelScript.RangeCopyType.all, false, false);
// Rename worksheet dinamically?!
let denumire: string;
denumire: Date;
sheet1.setName("denumire");
}
On a sharepoint excel I have used the record option to create small script that will copy the content of a specific sheet -> create a new one -> paste -> rename the sheet
On the online version, only Office Scrips work. Even if I upload a file that has a VBA macro, once uploaded it 'dissapears'.
I have tried to make the renaming of the sheet dinamically, the name being the date ( "December 9th" would have been ideal, but any format is better then none). No success so for.
Can anybody make any suggestions, please? Currently it just puts the string 'denumire' in there
----------------------------------------------------------------------------------------------------------------------------
function main(workbook: ExcelScript.Workbook) {
// Add a new worksheet
let sheet1 = workbook.addWorksheet();
let tracks = workbook.getWorksheet("Tracks");
// Paste range at Sheet1!A1 from Tracks!1:1048576
sheet1.getRange("A1")
.copyFrom(tracks.getRange("1:1048576"), ExcelScript.RangeCopyType.all, false, false);
// Rename worksheet dinamically?!
let denumire: string;
denumire: Date;
sheet1.setName("denumire");
}