我正在使用VB (通过Blueprism)尝试将工作簿另存为共享工作簿。handle、workbookname和filename都是输入的。错误消息:
Page: Save Workbook As
Stage: SaveWorkbookAs
Type: Error
Action: Validate
Description: Compiler error at line 8: 'xlShared' is not declared. It may be inaccessible due to its protection level.
Repairable: No代码:
newworkbookname = ExecWithTimeout(Timeout, "Save Workbook As",
Function()
Dim wb as Object = GetWorkbook(handle,workbookname)
Dim excel as Object = wb.Application
excel.DisplayAlerts = False
wb.SaveAs(filename)
wb.AccessMode =xlShared
excel.DisplayAlerts = True
Return wb.Name
End Function)发布于 2021-10-22 13:19:57
从Blueprism运行它几乎肯定意味着您不在Excel常量可用的范围内,因此您需要传递它所代表的显式整数值(在本例中为2) according to the XlSaveAsAccessMode enum
https://stackoverflow.com/questions/69648325
复制相似问题