Automation LibreOffice Calc 4.0 Examples for VB.NET

Hi All,

Anyone knows where I can get automation Calc 4.0 Examples for VB.NET ?
Recently, I have been upgraded to Calc 4.0 but my code is no longer run.
I was using Calc 3.6 previously and my code was running well.

Thanks in advance :slight_smile:

Hi @HandiRusli,

Are you looking for examples of VB.NET code for LO 4.0?

If your code was running in 3.6, then in general it should require no more than minor tweaks to be able to run in 4.0. Could you share an example of what’s no longer working for you or what’s giving you an error?

Hi @qubit1,

Here is my code for detecting LibO is Installed or not :

Public Shared Function IsInstalled() As Boolean
    Dim balik As Boolean
    Dim xContext As LibreOffice.uno.XComponentContext
    Dim MSFactory As LibreOffice.lang.XMultiServiceFactory

    Try
        xContext = uno.util.Bootstrap.bootstrap()
        MSFactory = DirectCast(xContext.getServiceManager(), LibreOffice.lang.XMultiServiceFactory)
        balik = True
    Catch oERROR As Exception
        balik = False
    End Try

    Return balik
End Function

This function is always failed to detect LibO 4.0, but it’s work perfectly in LibO 3.6

Am I missing something ?

Thanks :slight_smile:

Hi @HandiRusli, I’m not that familiar with this aspect of macros in LO. I upvoted your question and tagged it appropriately, so hopefully we can get you someone with a bit more experience in this area :slight_smile:

Thank you very much, really appreciated :slight_smile: