01-12-2021, 10:41 AM
The following code can only use absolute paths, why? how to use relative path?
video demo:
https://www92.zippyshare.com/v/kPVvVYNc/file.html
video demo:
https://www92.zippyshare.com/v/kPVvVYNc/file.html
C# code:
// script "edit.cs" /*/ ifRunning warn_restart; r Libraries\libxl\libxl.net.dll; resource example.xls; /*/ //.
using Au; using System;
using libxl;
partial class Script : AScript { [STAThread] static void Main(string[] a) => new Script(a); Script(string[] args) { //;;;
try
{
Book book = new BinBook();
// var s = "example.xls";
var s = @"C:\Users\Administrator\Documents\Aedit\Main\files\libxl\example.xls";
book.load(s);
Sheet sheet = book.getSheet(0);
double d = sheet.readNum(3, 1);
sheet.writeNum(3, 1, d * 2);
sheet.writeStr(4, 1, "new string");
// var s2 = "example_ok.xls";
var s2 = @"C:\Users\Administrator\Documents\Aedit\Main\files\libxl\example_ok.xls";
book.save(s2);
}
catch (System.Exception e)
{
Console.WriteLine(e.Message);
}
}
}