Macro Programming in LibreOffice Calc with BASIC - Introduction

Sdílet
Vložit
  • čas přidán 5. 08. 2024
  • In this video I will show you the basics of BASIC, the scripting language of LibreOffice Calc and Microsoft Excel. Programming in BASIC is simple, as I will show you.
    Files needed: github.com/snikolaj/libreoffi...
    Learn more:
    documentation.libreoffice.org...
    documentation.libreoffice.org...

Komentáře • 46

  • @projectnathanadam6232
    @projectnathanadam6232 Před 27 dny

    You have no idea how much your video has helped me! Thank you so much. I am a beginner and I was following along and add my own numbers, to which I didn't realize that I there is a limit to how big the numbers could be, other than that problem it went smoothly.

  • @TeaAndTankControls
    @TeaAndTankControls Před 4 dny

    That's a really good place to start. Thank you for the easy to follow instructions! It looks a lot like the VBA used in MS Office, but the built-in objects (such as ThisWorkbook) are different.

  • @mikecolley-
    @mikecolley- Před rokem +2

    PERFECT. I"m a compiled BASIC person and this explanation worked GREAT for me, I will refer back to it. If you do make a new video, please don't erase this video because it shows me so much and I will use this video as a reference over and over. PERFECT Video. Thank You!

  • @jorgealmeida3637
    @jorgealmeida3637 Před 3 lety +4

    I've learned a lot in a short time. Please continue. Thank you!

  • @henrylawson430
    @henrylawson430 Před 3 lety +4

    Thank you, very helpful. Needless to say this task could completed with formulas but it was great seeing how to do in Basic to get my head around writing macros.

  • @pratikmahamuni4856
    @pratikmahamuni4856 Před 2 lety

    Great video. I appreciate you putting the documentation as well!

  • @clarksims54
    @clarksims54 Před 2 lety +1

    This is a great tutorial. Thanks for posting.

  • @johnwysham5725
    @johnwysham5725 Před rokem

    This is just excellent. Am very grateful. Thank you!

  • @famalicao4760
    @famalicao4760 Před 2 lety +1

    Thank you very much ! Very good explanation, easy to understand, helped me very much!

  • @davidpaez_co
    @davidpaez_co Před 3 lety

    Thank you!

  • @martinfyhn1976
    @martinfyhn1976 Před 3 lety +3

    Great video, thank you.
    A couple of notes:
    - As it has been mentioned, the font size is a tad on the small side, especially on my phone 😂
    - If you do a final voiceover after you've finished recording, so it's more clear what you're saying, with less unfinished sentences, then it would be easier to retain the information you so graciously are sharing (it might just be me struggling with attention. My head is rather noisy, so it doesn't take much for me to lose track of what's being said)
    But keep up the good work 👍

    • @ackfee6086
      @ackfee6086  Před 3 lety +3

      Yeah looking at it now, I can see that. I use a 4K monitor so for me small font size is not a problem, but I agree. I fixed that in my last video, where I have some zooming and moving. On the topic of voiceover, I actually had a script for doing it live, but since I'm a bit socially awkward (you can see that since I'm programming spreadsheets), it didn't go as smoothly as planned. I definitely want to do some more videos, but I'm a bit unsure whether to post them since they're about electronics and graphics, not spreadsheets. Anyway, since this video I've learned a lot, even DIY'd a better microphone, so hopefully it gets better. Thanks for all your feedback!

    • @martinfyhn1976
      @martinfyhn1976 Před 3 lety

      @@ackfee6086 Yeah, just watched it, it's much more readable, and has good momentum - great improvements! 👍
      I see the e-mail account is empty, so it's probably sacrificial, but in case it's not, the address is visible in that video.
      Yeah - I'm not exactly a social genius either 😂 but I will say that especially the last video sounds like there's more confidence behind, so well done!
      You do write that it's a channel for everything, but if you plan on doing many more videos with varying contents, it could be a good idea to categorize it into different channels - but if nothing else, you can start out with dividing your videos into playlists.

  • @steve91311
    @steve91311 Před 2 lety +3

    "REM" does not mean 'reminder'. It has always meant 'remark'.

  • @ventjemazzel8822
    @ventjemazzel8822 Před měsícem

    Thank you

  • @varshneydevansh
    @varshneydevansh Před 6 měsíci

    thanks

  • @BlokeBritish
    @BlokeBritish Před 2 lety +1

    in excel vba there is a Userform in wich other controls can be added.
    similarly libre has the "Dialog"
    but vba has a Frame control wich can be added to a userform.
    this Frame can have other child controls too like a button
    Libre has no such Frame control
    so then , wat is the way to achieve the Frame like effect in Libre ?

  • @raymondroy77
    @raymondroy77 Před 2 lety

    I was wondering if you could create a macro manually for Advanced Filter. The Record Macro does not register changing sheet or any dropdown menu are not recorded. It would be greatly appreciated if this could be done. Thank you for sharing your knowledge with Us.

  • @kazanmain
    @kazanmain Před 4 lety +1

    thank you, now i can program my الغجر زنجي أسود macro, inshallah

  • @kapilvora
    @kapilvora Před rokem

    Hello, I'm new to learning Macros on Libreoffice Calc, I saw on other excel macros tutorials that there is a typing assistant to autofill the code and available commands for e.g. when you type activecell. a list of commands appears in a dropdown list with options like Activate, AddComment, Address etc. How do you get this in Libreoffice Basic?

  • @NavySturmGewehr
    @NavySturmGewehr Před 5 měsíci

    Is there a way to write a custom function and have the autofill work in calc?

  • @worcesterexchange554
    @worcesterexchange554 Před rokem

    It is good information but the display is too small to read, even at 1080 on quite a big screen. Any chance that you could re-record it zoomed in?

  • @petermartin5030
    @petermartin5030 Před 7 měsíci +1

    A good way to figure out how to do things in macros, is to record a macro while you do the operations manually in the spreadsheet. Then edit the macro and you will see how the operations you did have been programmed in a macro.

    • @ackfee6086
      @ackfee6086  Před 7 měsíci

      That is a great suggestion, however personally I've found that the macro recording process generates useless steps which can be confusing to new users and difficult to debug when something goes wrong, or if you want to change something.

  • @piotrbiy8712
    @piotrbiy8712 Před rokem

    Finally, after 30 years of occasional use of spreadsheets, I was forced to start programming. Apart from the fact that I mistyped "curSheet", which took me an embarrassingly long time to find, everything worked right out of the box. Thank you.
    PS For people like me, I'm posting something for copy-paste.
    REM ***** BASIC *****
    Sub Main
    Dim currDoc as object
    Dim currSheets as object
    Dim currSheet as object
    Dim currCell as object
    Const dodaj as integer=1000
    currDoc = ThisComponent
    If NOT currDoc.SupportsService("com.sun.star.sheet.SpreadsheetDocument") Then Exit Sub
    currSheets = currDoc.getSheets()
    currSheet = currSheets.getByIndex("Sheet1")
    For i = 1 To 10 Step 1
    currCell = currSheet.getCellByPosition(5,i)
    If currCell.String="" Then
    a = currSheet.getCellByPosition(1,i).value
    b = currSheet.getCellByPosition(0,i).value
    wynik = a*b+dodaj
    currCell = currSheet.getCellByPosition(6,i)
    currCell.value = wynik
    EndIf
    Next
    End Sub

  • @petermartin5030
    @petermartin5030 Před 7 měsíci +1

    A small correction: At time 10:20, the FOR loop will execute 101 times, not 100, because i starts at 0 not 1.

  • @Hunar1997
    @Hunar1997 Před 3 lety +5

    I wish you increased the fontsize, i cant see anything

  • @robcr8
    @robcr8 Před 3 lety

    I am trying to learn how to send an email reminder from officelibre calc table. I cannot find any documentation to teach me. Can this be done by a formula? Can you recommend anything?

    • @ackfee6086
      @ackfee6086  Před 3 lety

      I will make a video on this either today or tomorrow, so expect that, it's pretty easy but there are some Windows-specific things that can make it confusing. Stay tuned!

    • @robcr8
      @robcr8 Před 3 lety

      @@ackfee6086 wow.. thanks so much 👍

  • @tg5441
    @tg5441 Před 10 měsíci

    Is it compatible with vba for excel?

  • @youssh4975
    @youssh4975 Před 2 lety +1

    where can i get a list of ThisComponent's methods? this shit obscure af

  • @clayshippy2652
    @clayshippy2652 Před 3 lety

    Very helpful - but I can't read your code it's too small. Can you enlarge that for the next video please.

  • @unity3dconcepts434
    @unity3dconcepts434 Před 2 lety

    It would have been better if you had zoomed in a little bit. Very hard to view the video below 720p.

  • @kimchee94112
    @kimchee94112 Před 2 lety

    Would be better if you executed the program for someone like me not familiar with the procedures. Is there a trace routine for troubleshooting? Don't remembered BASIC was like this, lol.

    • @ackfee6086
      @ackfee6086  Před 2 lety +1

      The program was actually executed, Libreoffice just doesn't make it obvious. This is a special dialect of BASIC optimized for use with office programs. It's most similar to VBA. Anyways for the debugging you can use this official guide:
      help.libreoffice.org/latest/ro/text/sbasic/shared/01030300.html
      I might make another video with more programming tricks and projects soon.

  • @worcesterexchange554
    @worcesterexchange554 Před rokem

    Rem stands for Remark

  • @rayfellers
    @rayfellers Před rokem

    Starting from scratch with a blank sheet and running a macro to generate the spreadsheet content is what I hoped to find. This isn't it and the audio is so low that I can't hear it anyway even with my audio output set to max.

  • @lciavarella
    @lciavarella Před 3 lety +6

    I couldn't find my magnifying glass so it was hard to watch.

    • @thedanyesful
      @thedanyesful Před 3 lety

      what size is your monitor? looks fine on my 30 inch.

    • @PeachyNana1952
      @PeachyNana1952 Před 10 měsíci

      I can see it on my iPad. It’s difficult but possible.

  • @camcairns2584
    @camcairns2584 Před rokem +2

    The incessant comparison with other languages detracts. Anyone who has more than one language under their belt has learned to do it subliminally - or the benefits of not doing it all if they can avoid it.

    • @ackfee6086
      @ackfee6086  Před rokem

      Even though I agree that the didactic approach of the video can be improved, I do think that in this case incessant comparison with other languages has a net positive effect. Most people wouldn't learn LO BASIC as their first programming language, and neither would they use it as a main one. The intended audience of this video for me was beginner-advanced programmers who know other languages and need to make a script or two in LO BASIC, which I believe is the main way people interact with the language. Still, I agree that the comparisons might be excessive, but I don't think that they should be avoided.
      Once I have time, I would like to remake all of these videos now that I have improved my video-making somewhat.

  • @vamsikrishnapadala
    @vamsikrishnapadala Před 3 lety

    Thank you