MBS XLBookMBS LoadRaw issue

I’m trying to use the LoadRaw or the LoadRaw2 method in the XLBookMBS, but keep getting two errors on run/build.

“There is more than one method with this name but this does not match any of the available signatures.” and “Type mismatch error. Expected Boolean, but got int32.”

Dim bsExcel As BinaryStream
Dim eBook As New XLBookMBS(False)

if TargetWin32 then
  eBook.SetKey(mbsUser, mbsWinKey)
else
  eBook.SetKey(mbsUser, mbsMacKey)
end

If NOT eBook.LoadRaw(bsExcel) Then
  MsgBox "ERROR"
End

I’ve also tried using LoadRaw2 with the same error.

Dim cMess As String
cMess = "error here"
ebook = eBook.LoadRaw2(bsExcel,cMess)

Any help would be greatly appreciated.

Thanks!

So you get a compiler error?

LoadRaw(data as MemoryBlock) as boolean
LoadRaw(data as string) as boolean

Those take a string or memoryblock, but not a BinaryStream!
Please open binary stream and read content first.

Or better use Load method and pass folderitem or path as string:

Load(path as folderitem) as boolean
Load(path as string) as boolean

Don’t forget that XLBookMBS constructor gets a boolean for XLS (false) or XLSX (true) format.

Thanks Christian! That definitely helped set me in the right direction and it does work now. Just not with a version 2 file for Excel. Needless to say, we are getting rid of that and going strictly MBS.

Thanks again!

1 Like