Simplest way to import and run a BASIC macro?

I’m part of a group that uses a Calc worksheet which each person has filled with significant amounts of their own data. Each person keeps their own separate copy of the worksheet. They’ve been using it for some time.

There is a bug in the spreadsheet which I can fix with a Macro I’ve written.

If I distribute the macro to the users, what is the easiest, most user-friendly way to have users import and run this macro to fix their copy of the worksheet? Alternatively, what other technique can be used to correct a complex problem in a spreadsheet for many individual users?

Some people have suggested just sending out a fixed copy of the spreadsheet, but copying and pasting the volume and formatting of data that most people have accumulated is unsupportable.
Thanks in advance.

Possible solutions:

  • You can write a macro what is embedded in a file. And the macro will contol (and fix) an another document what has a SPECIFIC file name. Your partners must copy the file to same directory with the document to fix. Your macro must determine the actual (absolute) path of the file what contains the macro, and then the macro will able to open the another document, and can fix it, save it.
  • You can distribute the macro as an .oxt Extension. Every user can install an Extension (you can write a short description for the installing, if they have not experience in the .oxt installing).

Thank you very much, I will use your first suggestion.
I think I can improve the solution by including in my macro a dialog that asks the user to point to their file, thereby eliminating the need to have the macro only operate on a file with a specific name.

Yes, it is possible.

Assuming that your modules are in library “Standard”

  1. Tools>Macros>Organize>Basic… button [Organizer], tab “Libraries” and add some new library.
  2. On the “Modules” tab, move the module(s) to the new library.
  3. On the “Libraries” tab, select your library, click [Export…] and export as an extension (*.oxt)
    An extension package should be installable with a double-click or via menu:Tools>Extensions… [Add…]
1 Like