Ask Your Question
0

Add xlam file to LibreOffice Calc

asked 2019-02-09 10:04:46 +0200

mmasroorali gravatar image

How can I use add existing XLAM file (an Excel Macro-Enabled Add-In file that's used to add new functions to Excel) to LibreOffice Calc?

For example, here is an XLAM file which I would like very much to use.

Any help will be appreciated.

edit retag flag offensive close merge delete

Comments

Mike Kaganski gravatar imageMike Kaganski ( 2019-02-09 10:07:50 +0200 )edit

But how that web interface can be used in LibreOffice Calc?

mmasroorali gravatar imagemmasroorali ( 2019-02-09 10:54:24 +0200 )edit

Well - by reading and understanding. E.g., the first item it the "Downloads" section on that page tells "LibreOffice Extension with NUMBERTEXT and MONEYTEXT spreadsheet functions: numbertext-1.0.5.oxt (description) "

Mike Kaganski gravatar imageMike Kaganski ( 2019-02-09 11:40:24 +0200 )edit

Sorry. missed that one. Feel like a fool. Will give it a try and report back here.

mmasroorali gravatar imagemmasroorali ( 2019-02-09 11:43:51 +0200 )edit

That one works fine. But it does not take care of the local number system (crore, lakh) that has been used in the reported xlam file. Still appreciate pointing out to a method to use this xlam file.

mmasroorali gravatar imagemmasroorali ( 2019-02-09 12:20:13 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2019-02-09 13:04:16 +0200

updated 2019-02-09 13:42:47 +0200

Excel extensions are not compatible with LibreOffice, and there's no way to make them work with it. If you need some extension for LibreOffice, it must be created specifically for LibreOffice.

If NumberText extension does not include a language that you need, the best one could do is to contact authors and offer help in extending the capabilities of the extension. I suppose that even plain-text explanation of rules used in that language, plus testing results, could help a lot; but one could try own skills in creating own set of rules using NumberText's IDE that is available on the main page under "Add a new language" link.

FYI: The Excel extension contains this VBA macro:

Function SpellNumber(amt As Variant) As Variant
  Dim FIGURE As Variant
  Dim LENFIG As Integer
  Dim i As Integer
  Dim WORDs(19) As String
  Dim tens(9) As String
  WORDs(1) = "One"
  WORDs(2) = "Two"
  WORDs(3) = "Three"
  WORDs(4) = "Four"
  WORDs(5) = "Five"
  WORDs(6) = "Six"
  WORDs(7) = "Seven"
  WORDs(8) = "Eight"
  WORDs(9) = "Nine"
  WORDs(10) = "Ten"
  WORDs(11) = "Eleven"
  WORDs(12) = "Twelve"
  WORDs(13) = "Thirteen"
  WORDs(14) = "Fourteen"
  WORDs(15) = "Fifteen"
  WORDs(16) = "Sixteen"
  WORDs(17) = "Seventeen"
  WORDs(18) = "Eighteen"
  WORDs(19) = "Nineteen"
  tens(2) = "Twenty"
  tens(3) = "Thirty"
  tens(4) = "Fourty"
  tens(5) = "Fifty"
  tens(6) = "Sixty"
  tens(7) = "Seventy"
  tens(8) = "Eighty"
  tens(9) = "Ninety"
  FIGURE = amt
  FIGURE = Format(FIGURE, "FIXED")
  FIGLEN = Len(FIGURE)
  If FIGLEN < 12 Then
    FIGURE = Space(12 - FIGLEN) & FIGURE
  End If
  If Val(Left(FIGURE, 9)) > 1 Then
    SpellNumber = "Rupees "
  ElseIf Val(Left(FIGURE, 9)) = 1 Then
    SpellNumber = "Rupee "
  End If
  For i = 1 To 3
    If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
      SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2)))
    ElseIf Val(Left(FIGURE, 2)) > 19 Then
      SpellNumber = SpellNumber & tens(Val(Left(FIGURE, 1)))
      SpellNumber = SpellNumber & WORDs(Val(Right(Left(FIGURE, 2), 1)))
    End If
    If i = 1 And Val(Left(FIGURE, 2)) > 0 Then
      SpellNumber = SpellNumber & " Crore "
    ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then
      SpellNumber = SpellNumber & " Lakh "
    ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then
      SpellNumber = SpellNumber & " Thousand "
    End If
    FIGURE = Mid(FIGURE, 3)
  Next i
  If Val(Left(FIGURE, 1)) > 0 Then
    SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 1))) + " Hundred "
  End If
  FIGURE = Mid(FIGURE, 2)
  If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
    SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2)))
  ElseIf Val(Left(FIGURE, 2)) > 19 Then
    SpellNumber = SpellNumber & tens(Val(Left(FIGURE, 1)))
    SpellNumber = SpellNumber & WORDs(Val(Right(Left(FIGURE, 2), 1)))
  End If
  FIGURE = Mid(FIGURE, 4)
  If Val(FIGURE) > 0 Then
    SpellNumber = SpellNumber & " Paise "
    If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
      SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2)))
    ElseIf Val(Left(FIGURE, 2)) > 19 Then
      SpellNumber ...
(more)
edit flag offensive delete link more

Comments

While going through the tutorial for "en", some string caught my eye. Found eventually that using the language en-IN serves my purpose completely.

mmasroorali gravatar imagemmasroorali ( 2019-02-09 16:19:09 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-02-09 10:04:46 +0200

Seen: 167 times

Last updated: Feb 09