ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   do xl add-ins have worksheets? (https://www.excelbanter.com/excel-programming/385138-do-xl-add-ins-have-worksheets.html)

big t

do xl add-ins have worksheets?
 
hi everyone,

i always thought that xl add-ins do not have worksheets, but in the vbe i
can see Sheet1 (Sheet1) under Microsoft Excel Objects under my add-in.

and the 'Visible' property for this worksheet is -1 - xlSheetVisible.

basically, i want to use my add-in to store some options for the user, and
i'm looking for the easiest way to do this. i don't really want to mess
around with the registry or ini files if i can avoid it and i figured that if
there is a useable sheet in the add-in i can use that.

TIA,
big t


Tom Ogilvy

do xl add-ins have worksheets?
 
all excel workbooks must have at least on sheet. An addin is a special
workbook.

you can reference the sheet the same as you would any sheet (without
selecting)

set sh = Workbooks("MyAddin.xla").Worksheets(1)
sh1.Range("A1").Value = 10

or for code within the addin

set sh = thisworkbook.worksheets(1)



--
Regards,
Tom Ogilvy


"big t" wrote:

hi everyone,

i always thought that xl add-ins do not have worksheets, but in the vbe i
can see Sheet1 (Sheet1) under Microsoft Excel Objects under my add-in.

and the 'Visible' property for this worksheet is -1 - xlSheetVisible.

basically, i want to use my add-in to store some options for the user, and
i'm looking for the easiest way to do this. i don't really want to mess
around with the registry or ini files if i can avoid it and i figured that if
there is a useable sheet in the add-in i can use that.

TIA,
big t


Charles Williams

do xl add-ins have worksheets?
 
Yes XLA addins can have as many worksheets as you want. from VBA you can use
code like
Thisworkbook.worksheets("Sheet1").range("A1")
to refer to them.
If you modify any cells on these sheets you have to save the XLA otherwise
the modifications are lost when Excel closes.

Charles
______________________
Decision Models
FastExcel 2.3 now available
Name Manager 4.0 now available
www.DecisionModels.com

"big t" wrote in message
...
hi everyone,

i always thought that xl add-ins do not have worksheets, but in the vbe i
can see Sheet1 (Sheet1) under Microsoft Excel Objects under my add-in.

and the 'Visible' property for this worksheet is -1 - xlSheetVisible.

basically, i want to use my add-in to store some options for the user, and
i'm looking for the easiest way to do this. i don't really want to mess
around with the registry or ini files if i can avoid it and i figured that
if
there is a useable sheet in the add-in i can use that.

TIA,
big t




JE McGimpsey

do xl add-ins have worksheets?
 
Yes, add-ins have at least one worksheet, but the worksheets are not
visible.

You *can* use that sheet to store options - just make sure to have the
add-in save itself when the options are changed.

This is generally not the best practice, however. If others use the
add-in, you can't be sure they have write access to the add-in's
directory, and it's somewhat more vulnerable to corruption.

In article ,
big t wrote:

hi everyone,

i always thought that xl add-ins do not have worksheets, but in the vbe i
can see Sheet1 (Sheet1) under Microsoft Excel Objects under my add-in.

and the 'Visible' property for this worksheet is -1 - xlSheetVisible.

basically, i want to use my add-in to store some options for the user, and
i'm looking for the easiest way to do this. i don't really want to mess
around with the registry or ini files if i can avoid it and i figured that if
there is a useable sheet in the add-in i can use that.

TIA,
big t


big t

do xl add-ins have worksheets?
 
thanks for your answers.

just one more question...

....how come i can't see the sheets even though they are allegedly visible?

cheers
big t

"big t" wrote:

hi everyone,

i always thought that xl add-ins do not have worksheets, but in the vbe i
can see Sheet1 (Sheet1) under Microsoft Excel Objects under my add-in.

and the 'Visible' property for this worksheet is -1 - xlSheetVisible.

basically, i want to use my add-in to store some options for the user, and
i'm looking for the easiest way to do this. i don't really want to mess
around with the registry or ini files if i can avoid it and i figured that if
there is a useable sheet in the add-in i can use that.

TIA,
big t


Tom Ogilvy

do xl add-ins have worksheets?
 
Addins are designed to be invisible to the user.

Likewise, go to Window = Hide and hide a workbook.

from the immediate window:
? workbooks("Book2").Windows(1).Visible
False
? workbooks("Book2").Worksheets(1).Visible = xlSheetVisible
True


So sheet visibility is an attribute that is interpreted by excel to
determine whether the sheet is actually visible to the User.

--
Regards,
Tom Ogilvy

"big t" wrote:

thanks for your answers.

just one more question...

...how come i can't see the sheets even though they are allegedly visible?

cheers
big t

"big t" wrote:

hi everyone,

i always thought that xl add-ins do not have worksheets, but in the vbe i
can see Sheet1 (Sheet1) under Microsoft Excel Objects under my add-in.

and the 'Visible' property for this worksheet is -1 - xlSheetVisible.

basically, i want to use my add-in to store some options for the user, and
i'm looking for the easiest way to do this. i don't really want to mess
around with the registry or ini files if i can avoid it and i figured that if
there is a useable sheet in the add-in i can use that.

TIA,
big t


big t

do xl add-ins have worksheets?
 
i getcha. thanks Tom.

cheers
big t


"Tom Ogilvy" wrote:

Addins are designed to be invisible to the user.

Likewise, go to Window = Hide and hide a workbook.

from the immediate window:
? workbooks("Book2").Windows(1).Visible
False
? workbooks("Book2").Worksheets(1).Visible = xlSheetVisible
True


So sheet visibility is an attribute that is interpreted by excel to
determine whether the sheet is actually visible to the User.

--
Regards,
Tom Ogilvy

"big t" wrote:

thanks for your answers.

just one more question...

...how come i can't see the sheets even though they are allegedly visible?

cheers
big t

"big t" wrote:

hi everyone,

i always thought that xl add-ins do not have worksheets, but in the vbe i
can see Sheet1 (Sheet1) under Microsoft Excel Objects under my add-in.

and the 'Visible' property for this worksheet is -1 - xlSheetVisible.

basically, i want to use my add-in to store some options for the user, and
i'm looking for the easiest way to do this. i don't really want to mess
around with the registry or ini files if i can avoid it and i figured that if
there is a useable sheet in the add-in i can use that.

TIA,
big t



All times are GMT +1. The time now is 09:59 PM.

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