Cách sử dụng thư viện RCA.Excel.WorkbookApplication?

Một tháng trước em có viết đoạn code này để ẩn sheet 1 trong biến workbook là wbMikomi
wbMikomi.SetSheet(“Sheet1”, false)
wbMikomi.CurrentWorksheet.Visible = Microsoft.Office.Interop.Excel.XlSheetVisibility.xlSheetHidden
Giờ chạy lại lỗi như bên dưới:
Message: Error compiling code\n
error BC31000: The embedded interop type ‘Visible’ does not contain a definition for ‘Microsoft.Office.Interop.Excel.Worksheet’ since it was not used in the compiled assembly. Consider casting to object or changing the ‘Embed Interop Types’ property to true. At line 2
error BC30456: ‘XlSheetVisibility’ is not a member of ‘Excel’. At line 2

Stack trace: 
   at RCA.Activities.Core.CompilerRunner.Compile(String code, Int32 errLineOffset, Boolean generateInMemory)
   at RCA.Activities.Core.InvokeCode.GetCompilerRunner(String userCode, List`1 args, String imps)
   at RCA.Activities.Core.InvokeCode.Execute(CodeActivityContext context)
   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
2020/10/29 2:10:43 Information No0RoboTemplate execution ended

Không biết là giờ muốn ẩn sheet của 1 file excel thì phải làm thế nào trên akabot?

nhờ 2 anh @nhothuy , @HaiPT trải lời giúp em ạ

Hi @toannv,

Bạn cung cấp thêm một số thông tin về môi trường để tiện support nhé.

  1. akaBot Platform version.

  2. .Windows name & version ( Ấn vào Start menu > gõ winver )

  3. Zip và gửi folder logs: C:\ProgramData\akaBot\Logs và C:\Users\AppData\Local\akaBot\Logs

Best regards,
akaBot Support team

cảm ơn bạn mình vừa open file .xaml và thấy hình như bị xóa mất thư viện <AssemblyReference>Microsoft.Office.Interop.Excel</AssemblyReference>
thư viện này, trước đó mình copy rồi paste vào rồi, hình như bị tự động xóa mất hay có trích gì ở đây không nhỉ

Hi @toannv,
Bình thường là sẽ không bị mất ( chỉ có trường hợp mất điện đột ngột hoặc quên save khi copy & paste). Hiện nay, trường hợp file xamp bị hỏng là rất hiếm chỉ có case ghi nhận là file cấu hình json bị hỏng. Tuy nhiên, team sẽ tiếp tục theo dõi và kiểm tra thêm.

Cảm ơn @toannv

Best regards,
akaBot Support team.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.