What is the best way to package and distribute an Excel application

I wrote a tool to create an Excel database. Similarly, all VBA code is associated with one XLS file. The user creates a report by clicking the button on the toolbar. Unfortunately, if the user did not save the file under a different file name, all the reported data will be destroyed.

When I created similar tools in Word, I can put all the code in a template file (.dot) and call it from there. If I put the template file in the Office startup folder, it starts every time I start Word. Is there a similar way to package and distribute my code in Excel? I tried using add-ons, but I did not find a way to call the code from the application window.

+3
source share
5 answers

You can modify the user.xls file of the user, which is stored in the excel startup directory (depending on Office versions). If you have many users, this can be inconvenient.

An alternative way to solve your problem is to save the macro in a template file (.xlt). Then, when users open it, they cannot save it back to the original file, but must specify a new file name to save it as. The disadvantage of this method is that you get several copies of the source code all over the place with each saved file. If you change the source .xlt file and someone reloads the old macro in a previously saved .xls file, then everything may fail.

+2
source

Excel Addin (XLA) - ( % AppData%\Microsoft\Excel\XLSTART), , , .

, .

, Word, Excel Powerpoint (XLA, PPA, DOT), 2007 (DOTM, XLAM PPAM).

addin , , , //etc , ( , )

VBA, ...

, , - .. (, - , )

Public Sub Workbook_Open()
     ' startup code / add toolbar / load saved settings, etc.
End Sub

, :)

+10

Add-in (xla)/Template (xlt). ( ) . , (Access, SQLServer, xls).

- . , , , .

+1

ClickOnce Excel?

0
source

How to save a backup to a network folder with read-only permissions? Authentication can be done using integrated Windows authentication, and you do not need to save a password to connect to the database in VBA. Then you just need to share the link to this location with your users. If you upgrade, you will only change the data in this folder without notifying the user.

0
source

Source: https://habr.com/ru/post/1696550/


All Articles