Runtime Error messages check

What are the reasons for the below runtime error message?

System.Runtime.InteropServices.COMException (0x800401E3): Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))\r\n at System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& rclsid, IntPtr reserved, Object& ppunk)\r\n at System.Runtime.InteropServices.Marshal.GetActiveObject(String progID)\r\n at UiPath.Excel.WorkbookApplication…ctor(String workbookPath, String password, Boolean visible, Boolean createNew)"

1 Like

Hi there,

I guess you need to give some information about your automation in order for the community to provide a better answer.

In this case I think you are using an excel activity and a namespace is not declared or duplicated and you are trying to either get data from it or run a macro.

can you share your XAML file and the file you are trying to access please, I´ll be more than happy to help.


hey @beesheep

He is running a macro with excel.


1 Like

@aksh1yadav I thought so :slight_smile:

Then ask_565 (what a generic name :slight_smile: ) try to see if the module name is not the same as the macro name.


1 Like

hey @beesheep

i don’t know i was also waiting for more updates from his side but no response :slight_smile:


1 Like

UnZipFiles.xaml (9.1 KB)


Here is the work flow and the macro code. when I try to run this code I am getting the above error(same error for two more macro activities).

Sub UnzipFiles()
ParentFolderPath = Left(ThisWorkbook.Path, InStrRev(ThisWorkbook.Path, "") - 1)
myfolder = ParentFolderPath + "\Out"
destfolder = ParentFolderPath + "\Out"

Call Recursive(myfolder, destfolder)

End Sub

Sub Recursive(FolderPath As Variant, destfolder As Variant)
Dim Value As String, Folders() As String
Dim Folder As Variant, a As Long
Dim SApp As Object

ReDim Folders(0)

If Right(FolderPath, 2) = “\” Then Exit Sub
Value = Dir(FolderPath, &H1F)

Do Until Value = “”
If Value = “.” Or Value = “…” Then
If GetAttr(FolderPath & Value) = 16 Or GetAttr(FolderPath & Value) = 48 Then
Folders(UBound(Folders)) = Value
ReDim Preserve Folders(UBound(Folders) + 1)
If Right(Value, 4) = “.zip” Then
Set SApp = CreateObject(“Shell.Application”)
SApp.Namespace(destfolder).CopyHere _
SApp.Namespace(FolderPath & Value).items
End If
End If
End If
Value = Dir

For Each Folder In Folders
Call Recursive(FolderPath & Folder & "", destfolder)
Next Folder

End Sub

Thank you!

1 Like


thank you for your inquiry.

I see that you are trying to unzip files… take a look at this post about unziping files with UiPath

Happy automation. :sunglasses: