• OT: Libreofffice Calc Question

    From knuttle@keith_nuttle@yahoo.com to alt.comp.os.windows-11 on Tue Aug 25 07:09:30 2026
    From Newsgroup: alt.comp.os.windows-11

    For year I have used Corel Quattro Pro for my spreadsheet needs. Some
    times you open a spreadsheet for information, and sometimes you open it
    to make changes. When you open it for information you do not want to
    save accidentally changes by relying on the auto backup.

    In Quattro Pro I can designate a label cells and put SPREADSHEET
    commands that can be run from the spreadsheet. The routine set of
    commands are Save and Save As. The first Save saves the current
    spreadsheet and the second saves a backup file.

    This set of command is unique to and saved in the spreadsheet that can
    be run from a Button or the Run Macro function.

    Can this be done in LibreOffic Calc? I know you can set up a macro that
    is stored separately, but using this technique you end up with many "off
    site" macros. Then to use one I have to go through the macro list.

    For various reason I have had to start using LibreOffic for some of my work. --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Paul@nospam@needed.invalid to alt.comp.os.windows-11 on Tue Aug 25 12:07:04 2026
    From Newsgroup: alt.comp.os.windows-11

    On Tue, 8/25/2026 7:09 AM, knuttle wrote:
    For year I have used Corel Quattro Pro for my spreadsheet needs. Some times you open a spreadsheet for information, and sometimes you open it to make changes.  When you open it for information you do not want to save accidentally changes by relying on the auto backup.

    In Quattro Pro I can designate a label cells and put SPREADSHEET commands that can be run from the spreadsheet.  The routine set of commands are Save and Save As.  The first Save saves the current spreadsheet and the second saves a backup file.

    This set of command is unique to and saved in the spreadsheet that can be run from a Button or the Run Macro function.

    Can this be done in LibreOffic Calc?  I know you can set up a macro that is stored separately, but using this technique you end up with many "off site" macros.  Then to use one I have to go through the macro list.

    For various reason I have had to start using LibreOffic for some of my work.

    I'm not sure you'll be able to find a thread that exactly matches your question.

    https://ask.libreoffice.org/t/how-to-save-as-a-spreadsheet-with-macro/53882

    When you have cross-era/cross-domain questions like this, the LLM-AI
    has a much wider information store, than most spreadsheet users. Asking
    a question of CoPilot, is likely to get you an operational model
    and differences between the two environments. CoPilot is available
    in various ways - I use the icon in the upper right of a MSEdge browser window for this.

    ******************* CoPilot Question *************************

    For year I have used Corel Quattro Pro for my spreadsheet needs. Some times
    you open a spreadsheet for information, and sometimes you open it to make changes.

    When you open it for information you do not want to save accidentally changes by relying on the auto backup.

    In Quattro Pro I can designate a label cells and put SPREADSHEET commands that can be run from the spreadsheet.
    The routine set of commands are Save and Save As. The first Save saves the current spreadsheet and
    the second saves a backup file.

    This set of command is unique to and saved in the spreadsheet that can be run from a Button or the Run Macro function.

    Can this be done in LibreOffice Calc? I know you can set up a macro that is stored separately,
    but using this technique you end up with many macros outside of the file. Then to use one
    I have to go through the macro list.

    For various reason I have had to start using LibreOffice for some of my work.

    ********************** CoPilot Answer ***********************

    **Short answer:**
    Yes - LibreOffice Calc *can* do what you’re describing, but the mechanism is different from Quattro Pro. You **can embed macros inside the spreadsheet file itself**,
    attach them to buttons, and keep each file’s automation self‑contained. Calc doesn’t have Quattro Pro’s "command cells", but you can replicate the workflow cleanly.

    Below is the practical, architecture-level breakdown tailored to your Quattro Pro habits.

    ---

    ## Core requirement: "Macros stored *in the spreadsheet*, not globally" LibreOffice supports this directly.

    When you create a macro, you choose where it is stored:

    - **My Macros** --> global, shared across all documents
    - **LibreOffice Macros** --> built‑in
    - **This Document** --> *embedded inside the spreadsheet file*

    To match your Quattro Pro workflow, you want:

    **Tools --> Macros --> Organize Macros --> LibreOffice Basic --> [Your Spreadsheet]**

    Anything stored under your spreadsheet’s name travels with the file, no external macro clutter.

    ---

    ## Replicating your Quattro Pro "Save" and "Save As backup" commands
    You can create two macros inside the spreadsheet:

    ### 1. **Save the current spreadsheet**

    Sub SaveThisFile # Basic
    ThisComponent.store()
    End Sub


    ### 2. **Save a backup copy (Save As)**

    Sub SaveBackup # Basic
    Dim oDoc As Object
    Dim sURL As String

    oDoc = ThisComponent
    sURL = oDoc.URL

    ' Create backup filename
    Dim backupURL As String
    backupURL = Replace(sURL, ".ods", "_backup.ods")

    oDoc.storeToURL(backupURL, Array())
    End Sub


    These macros live *inside the spreadsheet file*, exactly like your Quattro Pro command set.

    ---

    ## Running macros from buttons (your Quattro Pro "button on the sheet" workflow)
    Calc supports this too.

    1. **View --> Toolbars --> Form Controls**
    2. Insert a **Push Button**
    3. Right-click --> **Control ...**
    4. Go to **Events** tab
    5. Assign your embedded macro to the button’s “Execute action” event

    Now your spreadsheet has its own self-contained Save / Save Backup buttons.

    ---

    ## Protecting yourself from accidental saves
    Calc doesn’t have Quattro Pro’s "command cell" paradigm,
    but you can achieve the same safety behavior:

    ### Option A — Open read‑only by default
    You can mark the file read‑only:

    - **File --> Properties --> Security --> Open file read-only**

    Then your Save macro becomes the *only* way to save changes.

    ### Option B — Macro that forces read‑only unless you explicitly unlock
    You can add a macro that runs on document open:


    Sub OnOpen_SetReadOnly # Basic
    ThisComponent.setReadOnly(True)
    End Sub


    Attach it via:

    **Tools --> Customize --> Events --> Open Document**

    Now the file opens read‑only unless you deliberately click your Save button.

    ---

    ## How close is this to Quattro Pro’s "command cells" ?
    Quattro Pro’s command cells are unique — Calc doesn’t execute spreadsheet-embedded commands from cell text. But the combination of:

    - embedded macros
    - buttons
    - document-level events
    - read-only protection

    gives you the same *workflow outcome*:

    Open for information --> safe
    Open for editing --> use your embedded Save / Save Backup buttons
    No global macro clutter
    Automation travels with the file

    ---

    ## If you want, I can build you a complete Calc template
    I can generate:

    - the full macro set
    - the button layout
    - optional "Open read‑only" logic
    - optional "Backup with timestamp" logic
    - optional "Backup to a specific folder" logic

    Just tell me how you want your Save / Backup workflow to behave.

    ********************** End: CoPilot Answer ***********************

    Paul

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From knuttle@keith_nuttle@yahoo.com to alt.comp.os.windows-11 on Tue Aug 25 14:35:51 2026
    From Newsgroup: alt.comp.os.windows-11

    On 08/25/2026 12:07 PM, Paul wrote:
    On Tue, 8/25/2026 7:09 AM, knuttle wrote:
    For year I have used Corel Quattro Pro for my spreadsheet needs. Some times you open a spreadsheet for information, and sometimes you open it to make changes.  When you open it for information you do not want to save accidentally changes by relying on the auto backup.

    In Quattro Pro I can designate a label cells and put SPREADSHEET commands that can be run from the spreadsheet.  The routine set of commands are Save and Save As.  The first Save saves the current spreadsheet and the second saves a backup file.

    This set of command is unique to and saved in the spreadsheet that can be run from a Button or the Run Macro function.

    Can this be done in LibreOffic Calc?  I know you can set up a macro that is stored separately, but using this technique you end up with many "off site" macros.  Then to use one I have to go through the macro list.

    For various reason I have had to start using LibreOffic for some of my work.

    I'm not sure you'll be able to find a thread that exactly matches your question.

    https://ask.libreoffice.org/t/how-to-save-as-a-spreadsheet-with-macro/53882

    When you have cross-era/cross-domain questions like this, the LLM-AI
    has a much wider information store, than most spreadsheet users. Asking
    a question of CoPilot, is likely to get you an operational model
    and differences between the two environments. CoPilot is available
    in various ways - I use the icon in the upper right of a MSEdge browser window for this.

    ******************* CoPilot Question *************************

    For year I have used Corel Quattro Pro for my spreadsheet needs. Some times you open a spreadsheet for information, and sometimes you open it to make changes.

    When you open it for information you do not want to save accidentally changes by relying on the auto backup.

    In Quattro Pro I can designate a label cells and put SPREADSHEET commands that can be run from the spreadsheet.
    The routine set of commands are Save and Save As. The first Save saves the current spreadsheet and
    the second saves a backup file.

    This set of command is unique to and saved in the spreadsheet that can be run from a Button or the Run Macro function.

    Can this be done in LibreOffice Calc? I know you can set up a macro that is stored separately,
    but using this technique you end up with many macros outside of the file. Then to use one
    I have to go through the macro list.

    For various reason I have had to start using LibreOffice for some of my work.

    ********************** CoPilot Answer ***********************

    **Short answer:**
    Yes - LibreOffice Calc *can* do what you’re describing, but the mechanism is
    different from Quattro Pro. You **can embed macros inside the spreadsheet file itself**,
    attach them to buttons, and keep each file’s automation self‑contained. Calc doesn’t have Quattro Pro’s "command cells", but you can replicate the workflow cleanly.

    Below is the practical, architecture-level breakdown tailored to your Quattro Pro habits.

    ---

    ## Core requirement: "Macros stored *in the spreadsheet*, not globally" LibreOffice supports this directly.

    When you create a macro, you choose where it is stored:

    - **My Macros** --> global, shared across all documents
    - **LibreOffice Macros** --> built‑in
    - **This Document** --> *embedded inside the spreadsheet file*

    To match your Quattro Pro workflow, you want:

    **Tools --> Macros --> Organize Macros --> LibreOffice Basic --> [Your Spreadsheet]**

    Anything stored under your spreadsheet’s name travels with the file, no external macro clutter.

    ---

    ## Replicating your Quattro Pro "Save" and "Save As backup" commands
    You can create two macros inside the spreadsheet:

    ### 1. **Save the current spreadsheet**

    Sub SaveThisFile # Basic
    ThisComponent.store()
    End Sub


    ### 2. **Save a backup copy (Save As)**

    Sub SaveBackup # Basic
    Dim oDoc As Object
    Dim sURL As String

    oDoc = ThisComponent
    sURL = oDoc.URL

    ' Create backup filename
    Dim backupURL As String
    backupURL = Replace(sURL, ".ods", "_backup.ods")

    oDoc.storeToURL(backupURL, Array())
    End Sub


    These macros live *inside the spreadsheet file*, exactly like your Quattro Pro command set.

    ---

    ## Running macros from buttons (your Quattro Pro "button on the sheet" workflow)
    Calc supports this too.

    1. **View --> Toolbars --> Form Controls**
    2. Insert a **Push Button**
    3. Right-click --> **Control ...**
    4. Go to **Events** tab
    5. Assign your embedded macro to the button’s “Execute action” event

    Now your spreadsheet has its own self-contained Save / Save Backup buttons.

    ---

    ## Protecting yourself from accidental saves
    Calc doesn’t have Quattro Pro’s "command cell" paradigm,
    but you can achieve the same safety behavior:

    ### Option A — Open read‑only by default
    You can mark the file read‑only:

    - **File --> Properties --> Security --> Open file read-only**

    Then your Save macro becomes the *only* way to save changes.

    ### Option B — Macro that forces read‑only unless you explicitly unlock You can add a macro that runs on document open:


    Sub OnOpen_SetReadOnly # Basic
    ThisComponent.setReadOnly(True)
    End Sub


    Attach it via:

    **Tools --> Customize --> Events --> Open Document**

    Now the file opens read‑only unless you deliberately click your Save button.

    ---

    ## How close is this to Quattro Pro’s "command cells" ?
    Quattro Pro’s command cells are unique — Calc doesn’t execute spreadsheet-embedded commands from cell text. But the combination of:

    - embedded macros
    - buttons
    - document-level events
    - read-only protection

    gives you the same *workflow outcome*:

    Open for information --> safe
    Open for editing --> use your embedded Save / Save Backup buttons
    No global macro clutter
    Automation travels with the file

    ---

    ## If you want, I can build you a complete Calc template
    I can generate:

    - the full macro set
    - the button layout
    - optional "Open read‑only" logic
    - optional "Backup with timestamp" logic
    - optional "Backup to a specific folder" logic

    Just tell me how you want your Save / Backup workflow to behave.

    ********************** End: CoPilot Answer ***********************

    Paul
    Unless there is a way to pull the current file name into a macro, and
    then save the file name with the native extension ie: xlsx,qpw, etc. and
    with a different extension to denote backup file

    You would have to write a macro for each spreadsheet you use and keep it
    in its own location

    That is exactly what I am trying to avoid.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Paul@nospam@needed.invalid to alt.comp.os.windows-11 on Tue Aug 25 18:45:50 2026
    From Newsgroup: alt.comp.os.windows-11

    On Tue, 8/25/2026 2:35 PM, knuttle wrote:
    On 08/25/2026 12:07 PM, Paul wrote:
    On Tue, 8/25/2026 7:09 AM, knuttle wrote:
    For year I have used Corel Quattro Pro for my spreadsheet needs. Some times you open a spreadsheet for information, and sometimes you open it to make changes.  When you open it for information you do not want to save accidentally changes by relying on the auto backup.

    In Quattro Pro I can designate a label cells and put SPREADSHEET commands that can be run from the spreadsheet.  The routine set of commands are Save and Save As.  The first Save saves the current spreadsheet and the second saves a backup file.

    This set of command is unique to and saved in the spreadsheet that can be run from a Button or the Run Macro function.

    Can this be done in LibreOffic Calc?  I know you can set up a macro that is stored separately, but using this technique you end up with many "off site" macros.  Then to use one I have to go through the macro list.

    For various reason I have had to start using LibreOffic for some of my work.

    I'm not sure you'll be able to find a thread that exactly matches your question.

        https://ask.libreoffice.org/t/how-to-save-as-a-spreadsheet-with-macro/53882

    When you have cross-era/cross-domain questions like this, the LLM-AI
    has a much wider information store, than most spreadsheet users. Asking
    a question of CoPilot, is likely to get you an operational model
    and differences between the two environments. CoPilot is available
    in various ways - I use the icon in the upper right of a MSEdge browser window for this.

    ******************* CoPilot Question *************************

    For year I have used Corel Quattro Pro for my spreadsheet needs. Some times >> you open a spreadsheet for information, and sometimes you open it to make changes.

    When you open it for information you do not want to save accidentally changes by relying on the auto backup.

    In Quattro Pro I can designate a label cells and put SPREADSHEET commands that can be run from the spreadsheet.
    The routine set of commands are Save and Save As.  The first Save saves the current spreadsheet and
    the second saves a backup file.

    This set of command is unique to and saved in the spreadsheet that can be run from a Button or the Run Macro function.

    Can this be done in LibreOffice Calc?  I know you can set up a macro that is stored separately,
    but using this technique you end up with many macros outside of the file. Then to use one
    I have to go through the macro list.

    For various reason I have had to start using LibreOffice for some of my work.

    ********************** CoPilot Answer ***********************

    **Short answer:**
    Yes - LibreOffice Calc *can* do what you’re describing, but the mechanism is
    different from Quattro Pro. You **can embed macros inside the spreadsheet file itself**,
    attach them to buttons, and keep each file’s automation self‑contained. >> Calc doesn’t have Quattro Pro’s "command cells", but you can replicate the workflow cleanly.

    Below is the practical, architecture-level breakdown tailored to your Quattro Pro habits.

    ---

    ##  Core requirement: "Macros stored *in the spreadsheet*, not globally"
    LibreOffice supports this directly.

    When you create a macro, you choose where it is stored:

    - **My Macros** --> global, shared across all documents
    - **LibreOffice Macros** --> built‑in
    - **This Document** --> *embedded inside the spreadsheet file*

    To match your Quattro Pro workflow, you want:

    **Tools --> Macros --> Organize Macros --> LibreOffice Basic --> [Your Spreadsheet]**

    Anything stored under your spreadsheet’s name travels with the file, no external macro clutter.

    ---

    ##  Replicating your Quattro Pro "Save" and "Save As backup" commands
    You can create two macros inside the spreadsheet:

    ### 1. **Save the current spreadsheet**

    Sub SaveThisFile                       # Basic
         ThisComponent.store()
    End Sub


    ### 2. **Save a backup copy (Save As)**

    Sub SaveBackup                         # Basic
         Dim oDoc As Object
         Dim sURL As String

         oDoc = ThisComponent
         sURL = oDoc.URL

         ' Create backup filename
         Dim backupURL As String
         backupURL = Replace(sURL, ".ods", "_backup.ods")

         oDoc.storeToURL(backupURL, Array())
    End Sub


    These macros live *inside the spreadsheet file*, exactly like your Quattro Pro command set.

    ---

    ##  Running macros from buttons (your Quattro Pro "button on the sheet" workflow)
    Calc supports this too.

    1. **View --> Toolbars --> Form Controls**
    2. Insert a **Push Button**
    3. Right-click --> **Control ...**
    4. Go to **Events** tab
    5. Assign your embedded macro to the button’s “Execute action” event >>
    Now your spreadsheet has its own self-contained Save / Save Backup buttons. >>
    ---

    ##  Protecting yourself from accidental saves
    Calc doesn’t have Quattro Pro’s "command cell" paradigm,
    but you can achieve the same safety behavior:

    ### Option A — Open read‑only by default
    You can mark the file read‑only:

    - **File --> Properties --> Security --> Open file read-only**

    Then your Save macro becomes the *only* way to save changes.

    ### Option B — Macro that forces read‑only unless you explicitly unlock >> You can add a macro that runs on document open:


    Sub OnOpen_SetReadOnly                      # Basic
         ThisComponent.setReadOnly(True)
    End Sub


    Attach it via:

    **Tools --> Customize --> Events --> Open Document**

    Now the file opens read‑only unless you deliberately click your Save button.

    ---

    ##  How close is this to Quattro Pro’s "command cells" ?
    Quattro Pro’s command cells are unique — Calc doesn’t execute
    spreadsheet-embedded commands from cell text. But the combination of:

    - embedded macros
    - buttons
    - document-level events
    - read-only protection

    gives you the same *workflow outcome*:

    Open for information --> safe
    Open for editing --> use your embedded Save / Save Backup buttons
    No global macro clutter
    Automation travels with the file

    ---

    ##  If you want, I can build you a complete Calc template
    I can generate:

    - the full macro set
    - the button layout
    - optional "Open read‑only" logic
    - optional "Backup with timestamp" logic
    - optional "Backup to a specific folder" logic

    Just tell me how you want your Save / Backup workflow to behave.

    ********************** End: CoPilot Answer ***********************

        Paul
    Unless there is a way to pull the current file name into a macro, and then save the file name with the native extension ie: xlsx,qpw, etc. and with a different extension to denote backup file

    You would have to write a macro for each spreadsheet you use and keep it in its own location

    That is exactly what I am trying to avoid.

    Without asking the LLM-AI the question, there must be an environment variable with the current file path in it. Seeing as this is the high-runner case.

    It would seem, this script saves the file you have open.

    Sub SaveThisFile # Basic
    ThisComponent.store()
    End Sub

    Experiment with that.

    Notice how the other script starts with "ThisComponent"
    as the anchor for its preparation of a backup file.
    And it then converts ThisComponent to a URL and works
    on editing that, before using it.

    Put on your programmer hat, and think like a programmer :-)

    Paul
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Bennett Price@bjprice@cal.berkeley.edu to alt.comp.os.windows-11 on Wed Aug 26 10:19:05 2026
    From Newsgroup: alt.comp.os.windows-11

    On 8/25/2026 4:09 AM, knuttle wrote:
    For year I have used Corel Quattro Pro for my spreadsheet needs. Some
    times you open a spreadsheet for information, and sometimes you open it
    to make changes.  When you open it for information you do not want to
    save accidentally changes by relying on the auto backup.

    In Quattro Pro I can designate a label cells and put SPREADSHEET
    commands that can be run from the spreadsheet.  The routine set of
    commands are Save and Save As.  The first Save saves the current spreadsheet and the second saves a backup file.

    This set of command is unique to and saved in the spreadsheet that can
    be run from a Button or the Run Macro function.

    Can this be done in LibreOffic Calc?  I know you can set up a macro that
    is stored separately, but using this technique you end up with many "off site" macros.  Then to use one I have to go through the macro list.

    For various reason I have had to start using LibreOffic for some of my
    work.
    Take a look at Tools-> Options -> Load/Save -> General. It looks like
    you can specify there what will work for you.
    --- Synchronet 3.21d-Linux NewsLink 1.2