Hi,
I am using the following simple java program to convert from html to excel:
import com.aspose.cells.License;
import com.aspose.cells.HTMLLoadOptions;
import com.aspose.cells.LoadFormat;
import com.aspose.cells.SaveFormat;
import com.aspose.cells.Workbook;
public class asposeConvert {
public static void main(String[] args) {
License license = new License();
license.setLicense("Aspose.Cells.lic");
if ( !License.isLicenseSet()) {
System.err.println("License is not set");
} else {
Workbook book;
int format = SaveFormat.XLSX;
WorkBook book = new Workbook(args[0]);
book.save(args[1], format);
}
}
}
If the input filename is a relative path like
java -classpath "aspose-cells-8.6.1.6.jar:." asposeConvert Test1.html Test1.xlsx
the program throws exception like the following:
ava.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1954)
at com.aspose.cells.zafc.b(Unknown Source)
at com.aspose.cells.zafc.a(Unknown Source)
at com.aspose.cells.zafi.o(Unknown Source)
at com.aspose.cells.zafi.l(Unknown Source)
at com.aspose.cells.zafj.a(Unknown Source)
at com.aspose.cells.zafj.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at asposeConvert.main(asposeConvert.java:20)
If I use a fullpath name, like,
java -classpath "aspose-cells-8.6.1.6.jar:." asposeConvert /data/fullpath/Test1.html Test1.xlsx
then the java program runs fine.
-fastPitch