大家好我在尝试从excel文件导入数据时遇到错误。当lotusscript打开工作簿时,我得到的错误为“
" Microsoft Excel: Office has detected a problem with this file cannot be opened. Error in XlsWeb In Initialise 70"`
在第70行,我正在尝试打开工作簿。
Set xlsApp = CreateObject("Excel Application");
MessageBox varfilename
xlsApp.Workbooks.Open varfilename
在日志中
E:\temp\09-09-2016042956AM.xls
我有一些文件导入正确,但我收到它的文件无法打开文件并给我这个错误。如果文件有任何问题,请告诉我。我想在编码时没有错误,因为我们的其他文件正常工作
答案 0 :(得分:-1)
根本不要使用xlsApp.Workbooks.Open,但要使Excel可见并为用户提供控制
private void takeScreenshot() {
Date now = new Date();
android.text.format.DateFormat.format("yyyy-MM-dd_hh:mm:ss", now);
try {
// image naming and path to include sd card appending name you choose for file
String mPath = Environment.getExternalStorageDirectory().toString() + "/" + now + ".jpg";
// create bitmap screen capture
View v1 = getWindow().getDecorView().getRootView();
v1.setDrawingCacheEnabled(true);
Bitmap bitmap = Bitmap.createBitmap(v1.getDrawingCache());
v1.setDrawingCacheEnabled(false);
File imageFile = new File(mPath);
FileOutputStream outputStream = new FileOutputStream(imageFile);
int quality = 100;
bitmap.compress(Bitmap.CompressFormat.JPEG, quality, outputStream);
outputStream.flush();
outputStream.close();
openScreenshot(imageFile);
} catch (Throwable e) {
// Several error may come out with file handling or OOM
e.printStackTrace();
}
}
然后只是'结束Sub'超出常规。