ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Savings settings for an add-in in the add-in's own worksheets (https://www.excelbanter.com/excel-programming/377089-savings-settings-add-add-ins-own-worksheets.html)

dodgo

Savings settings for an add-in in the add-in's own worksheets
 
Hi,

This is just question about good practices...

I would like to save settings that accompany an add-in that formats
structured text files into useful spreadsheets. There are essentially 3
short lists that need to be stored, 1 list of names and 2 lists of
bools. They are wiped and recreated when settings need to be changed.
They only need to be accessed by the add-in.

On every thread and website I've looked at, it's recommended using .ini
files or the registry. I found it was very easy to simply use 3
vba-named sheets in the add-in, and reference the values by the
sheetname.cells(index). There is a settings macro that stores the new
settings when required using inputboxes and msgboxes and saves them
using thisworkbook.save. Is there any reason why this would be
dangerous or considered bad practice?

(I realise a nice dialog would be better for the input, but the
settings would be changed only once every couple of years or so, if at
all, and only 4 or 5 input boxes and 8 or 10 msgboxes would need to be
negotiated with.)

Thanks,
Michael Lodge


Bob Phillips

Savings settings for an add-in in the add-in's own worksheets
 
Two things that immediately occur if you save within the addin. First is
that you have to save the file yourself, it doesn't automatically get saved.
Second is that you are restricting the add-in to a single user per machine.
If you write to the add-in itself, any other user who uses it will get those
changes, if you write to the registry you can have different settings per
user.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"dodgo" wrote in message
ups.com...
Hi,

This is just question about good practices...

I would like to save settings that accompany an add-in that formats
structured text files into useful spreadsheets. There are essentially 3
short lists that need to be stored, 1 list of names and 2 lists of
bools. They are wiped and recreated when settings need to be changed.
They only need to be accessed by the add-in.

On every thread and website I've looked at, it's recommended using .ini
files or the registry. I found it was very easy to simply use 3
vba-named sheets in the add-in, and reference the values by the
sheetname.cells(index). There is a settings macro that stores the new
settings when required using inputboxes and msgboxes and saves them
using thisworkbook.save. Is there any reason why this would be
dangerous or considered bad practice?

(I realise a nice dialog would be better for the input, but the
settings would be changed only once every couple of years or so, if at
all, and only 4 or 5 input boxes and 8 or 10 msgboxes would need to be
negotiated with.)

Thanks,
Michael Lodge




dodgo

Savings settings for an add-in in the add-in's own worksheets
 
Thanks Bob,

The add-in saves itself at the end of the macro that gets the settings
using ThisWorkbook.Save; and forcing everyone to use the same settings
is beneficial as they are based on the global settings of an external
financial system.

If they're the only issues, then I feel what I'm doing is quite
suitable in this case.

Michael



Bob Phillips wrote:
Two things that immediately occur if you save within the addin. First is
that you have to save the file yourself, it doesn't automatically get saved.
Second is that you are restricting the add-in to a single user per machine.
If you write to the add-in itself, any other user who uses it will get those
changes, if you write to the registry you can have different settings per
user.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"dodgo" wrote in message
ups.com...
Hi,

This is just question about good practices...

I would like to save settings that accompany an add-in that formats
structured text files into useful spreadsheets. There are essentially 3
short lists that need to be stored, 1 list of names and 2 lists of
bools. They are wiped and recreated when settings need to be changed.
They only need to be accessed by the add-in.

On every thread and website I've looked at, it's recommended using .ini
files or the registry. I found it was very easy to simply use 3
vba-named sheets in the add-in, and reference the values by the
sheetname.cells(index). There is a settings macro that stores the new
settings when required using inputboxes and msgboxes and saves them
using thisworkbook.save. Is there any reason why this would be
dangerous or considered bad practice?

(I realise a nice dialog would be better for the input, but the
settings would be changed only once every couple of years or so, if at
all, and only 4 or 5 input boxes and 8 or 10 msgboxes would need to be
negotiated with.)

Thanks,
Michael Lodge




All times are GMT +1. The time now is 04:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com