Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default xlb size and addin with custom toolbar

Hello all,

I have written an workbook with its own custom toolbar. I have attached the
workbook to task schedule and it runs every 5 minutes. No issues.

However, I have recently noticed that everytime the workbook opens/closes,
my XLB file increases in size by 3KB each time. As you can image, the XLB
file can become extremely large in month. I know I can delete XLB and "start
over", however, I was planning on giving the macro workbook to others and I
didn't want to have to remember to "clean up" their XLB every month.

I tested the opening and closing of Excel (NOT using my macro workbook) and
it increases the XLB by 1KB every 3 or 4 times a workbook is open.

Is there some kind of newbie thing I did when writing my macro or creating
my custom toolbar that is increasing the XLB so quickly? In my macro, I do
"test" upon opening of the macro workbook to see if my custom toolbar exists
(and if it does not, I create it) and then the "auto open macro" attaches the
proper macro to the individual custom toolbar icons.

Any help would be greatly appreciated.

MSweetG222

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default xlb size and addin with custom toolbar

Post your code, but I suspect you are not deleting the Toolbar when the
workbook closes.

See code at Debra Dalgleish's site for creating and deleting a toolbar.

http://www.contextures.on.ca/xlToolbar02.html


Gord Dibben MS Excel MVP

On Wed, 22 Oct 2008 14:26:04 -0700, MSweetG222
wrote:

Hello all,

I have written an workbook with its own custom toolbar. I have attached the
workbook to task schedule and it runs every 5 minutes. No issues.

However, I have recently noticed that everytime the workbook opens/closes,
my XLB file increases in size by 3KB each time. As you can image, the XLB
file can become extremely large in month. I know I can delete XLB and "start
over", however, I was planning on giving the macro workbook to others and I
didn't want to have to remember to "clean up" their XLB every month.

I tested the opening and closing of Excel (NOT using my macro workbook) and
it increases the XLB by 1KB every 3 or 4 times a workbook is open.

Is there some kind of newbie thing I did when writing my macro or creating
my custom toolbar that is increasing the XLB so quickly? In my macro, I do
"test" upon opening of the macro workbook to see if my custom toolbar exists
(and if it does not, I create it) and then the "auto open macro" attaches the
proper macro to the individual custom toolbar icons.

Any help would be greatly appreciated.

MSweetG222


  #3   Report Post  
Posted to microsoft.public.excel.programming
JAC JAC is offline
external usenet poster
 
Posts: 31
Default xlb size and addin with custom toolbar

On 22 Oct, 22:26, MSweetG222
wrote:
Hello all,

I have written an workbook with its own custom toolbar. *I have attached the
workbook to task schedule and it runs every 5 minutes. *No issues. *

However, I have recently noticed that everytime the workbook opens/closes,
my XLB file increases in size by 3KB each time. *As you can image, the XLB
file can become extremely large in month. *I know I can delete XLB and "start
over", however, I was planning on giving the macro workbook to others and I
didn't want to have to remember to "clean up" their XLB every month. *

I tested the opening and closing of Excel (NOT using my macro workbook) and
it increases the XLB by 1KB every 3 or 4 times a workbook is *open.

Is there some kind of newbie thing I did when writing my macro or creating
my custom toolbar that is increasing the XLB so quickly? *In my macro, I do
"test" upon opening of the macro workbook to see if my custom toolbar exists
(and if it does not, I create it) and then the "auto open macro" attaches the
proper macro to the individual custom toolbar icons.

Any help would be greatly appreciated.

MSweetG222


Try something like this, where you add temporary:=True while adding
the control. It creates a temporary facility that dies when you close
your workbook.

Private Sub AddHelp()
Dim cbWSMenu As CommandBar
Dim mnuXL As CommandBarControl

' Attach a temporary option to the Help menu for the application

On Error Resume Next

Set cbWSMenu = Application.CommandBars("Worksheet Menu Bar")

If Not cbWSMenu Is Nothing Then
Set mnuXL = cbWSMenu.Controls("Help")

If Not mnuXL Is Nothing Then
With mnuXL
With .Controls.Add(Type:=msoControlButton,
temporary:=True)
.Caption = "&XLHelp"
.OnAction = "XLHelp"
End With
End With

Set mnuXL = Nothing
End If

Set cbWSMenu = Nothing
End If
End Sub
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default xlb size and addin with custom toolbar

You are correct, I do not delete my toolbar upon closing my workbook. I was
allowing users to place the toolbar where they want. I didn't want them to
have to move it each time they opened the workbook. I will take a look at
making it temporary.
--
Thx
MSweetG222



"Gord Dibben" wrote:

Post your code, but I suspect you are not deleting the Toolbar when the
workbook closes.

See code at Debra Dalgleish's site for creating and deleting a toolbar.

http://www.contextures.on.ca/xlToolbar02.html


Gord Dibben MS Excel MVP

On Wed, 22 Oct 2008 14:26:04 -0700, MSweetG222
wrote:

Hello all,

I have written an workbook with its own custom toolbar. I have attached the
workbook to task schedule and it runs every 5 minutes. No issues.

However, I have recently noticed that everytime the workbook opens/closes,
my XLB file increases in size by 3KB each time. As you can image, the XLB
file can become extremely large in month. I know I can delete XLB and "start
over", however, I was planning on giving the macro workbook to others and I
didn't want to have to remember to "clean up" their XLB every month.

I tested the opening and closing of Excel (NOT using my macro workbook) and
it increases the XLB by 1KB every 3 or 4 times a workbook is open.

Is there some kind of newbie thing I did when writing my macro or creating
my custom toolbar that is increasing the XLB so quickly? In my macro, I do
"test" upon opening of the macro workbook to see if my custom toolbar exists
(and if it does not, I create it) and then the "auto open macro" attaches the
proper macro to the individual custom toolbar icons.

Any help would be greatly appreciated.

MSweetG222



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default xlb size and addin with custom toolbar

JAC,

You and Gord are correct, my toolbar is not temporary. I was hoping that
the users could place the toolbar where they wanted and it would be there
when they opened the workbook again.
--
Thx
MSweetG222



"JAC" wrote:

On 22 Oct, 22:26, MSweetG222
wrote:
Hello all,

I have written an workbook with its own custom toolbar. I have attached the
workbook to task schedule and it runs every 5 minutes. No issues.

However, I have recently noticed that everytime the workbook opens/closes,
my XLB file increases in size by 3KB each time. As you can image, the XLB
file can become extremely large in month. I know I can delete XLB and "start
over", however, I was planning on giving the macro workbook to others and I
didn't want to have to remember to "clean up" their XLB every month.

I tested the opening and closing of Excel (NOT using my macro workbook) and
it increases the XLB by 1KB every 3 or 4 times a workbook is open.

Is there some kind of newbie thing I did when writing my macro or creating
my custom toolbar that is increasing the XLB so quickly? In my macro, I do
"test" upon opening of the macro workbook to see if my custom toolbar exists
(and if it does not, I create it) and then the "auto open macro" attaches the
proper macro to the individual custom toolbar icons.

Any help would be greatly appreciated.

MSweetG222


Try something like this, where you add temporary:=True while adding
the control. It creates a temporary facility that dies when you close
your workbook.

Private Sub AddHelp()
Dim cbWSMenu As CommandBar
Dim mnuXL As CommandBarControl

' Attach a temporary option to the Help menu for the application

On Error Resume Next

Set cbWSMenu = Application.CommandBars("Worksheet Menu Bar")

If Not cbWSMenu Is Nothing Then
Set mnuXL = cbWSMenu.Controls("Help")

If Not mnuXL Is Nothing Then
With mnuXL
With .Controls.Add(Type:=msoControlButton,
temporary:=True)
.Caption = "&XLHelp"
.OnAction = "XLHelp"
End With
End With

Set mnuXL = Nothing
End If

Set cbWSMenu = Nothing
End If
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default xlb size and addin with custom toolbar

Hello All,

I am going to add this for documentation purposes.

Here is a sample of my code line:
Set cbCustomMenu = cbMainMenuBar.Controls.Add(Type:=10, Befo=iHelpMenu,
Temporary:=True)

Even though my CustomMenu's Temporary parameter is set to "True". The
"Temporary" parameter is supposed to remove the CustomMenu as Excel closes.
While that may be happening, Excel must still be recording the CustomMenu in
the XLB file, because the XLB increased by 3KB. At 3KB per session of Excel,
this will bloat the XLB file fairly quickly. Since I am using Excel in the
Task Schedule every 5 minutes, it will bloat faster than normal.

So I had to modify to the Auto_Close procedure to include this line of code
....

Application.CommandBars("Worksheet Menu
Bar").Controls("&CustomMenuName").Delete

Actually deleting the CommandBar before the Excel workbook is close actually
prevents the XLB bloat issue. I don't know if this is the right answer, but
it certainly solves the bloat issue.

--
Thx
MSweetG222



"MSweetG222" wrote:

Hello all,

I have written an workbook with its own custom toolbar. I have attached the
workbook to task schedule and it runs every 5 minutes. No issues.

However, I have recently noticed that everytime the workbook opens/closes,
my XLB file increases in size by 3KB each time. As you can image, the XLB
file can become extremely large in month. I know I can delete XLB and "start
over", however, I was planning on giving the macro workbook to others and I
didn't want to have to remember to "clean up" their XLB every month.

I tested the opening and closing of Excel (NOT using my macro workbook) and
it increases the XLB by 1KB every 3 or 4 times a workbook is open.

Is there some kind of newbie thing I did when writing my macro or creating
my custom toolbar that is increasing the XLB so quickly? In my macro, I do
"test" upon opening of the macro workbook to see if my custom toolbar exists
(and if it does not, I create it) and then the "auto open macro" attaches the
proper macro to the individual custom toolbar icons.

Any help would be greatly appreciated.

MSweetG222

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default xlb size and addin with custom toolbar

Which you were told to do October 22nd when you first posted.

From my reply to you then......................

Post your code, but I suspect you are not deleting the Toolbar when the
workbook closes.



Gord Dibben MS Excel MVP

On Mon, 27 Oct 2008 12:07:35 -0700, MSweetG222
wrote:

So I had to modify to the Auto_Close procedure to include this line of code


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default xlb size and addin with custom toolbar

Thank you JAC, I will try.
--
Thx
MSweetG222



"JAC" wrote:

On 22 Oct, 22:26, MSweetG222
wrote:
Hello all,

I have written an workbook with its own custom toolbar. I have attached the
workbook to task schedule and it runs every 5 minutes. No issues.

However, I have recently noticed that everytime the workbook opens/closes,
my XLB file increases in size by 3KB each time. As you can image, the XLB
file can become extremely large in month. I know I can delete XLB and "start
over", however, I was planning on giving the macro workbook to others and I
didn't want to have to remember to "clean up" their XLB every month.

I tested the opening and closing of Excel (NOT using my macro workbook) and
it increases the XLB by 1KB every 3 or 4 times a workbook is open.

Is there some kind of newbie thing I did when writing my macro or creating
my custom toolbar that is increasing the XLB so quickly? In my macro, I do
"test" upon opening of the macro workbook to see if my custom toolbar exists
(and if it does not, I create it) and then the "auto open macro" attaches the
proper macro to the individual custom toolbar icons.

Any help would be greatly appreciated.

MSweetG222


Try something like this, where you add temporary:=True while adding
the control. It creates a temporary facility that dies when you close
your workbook.

Private Sub AddHelp()
Dim cbWSMenu As CommandBar
Dim mnuXL As CommandBarControl

' Attach a temporary option to the Help menu for the application

On Error Resume Next

Set cbWSMenu = Application.CommandBars("Worksheet Menu Bar")

If Not cbWSMenu Is Nothing Then
Set mnuXL = cbWSMenu.Controls("Help")

If Not mnuXL Is Nothing Then
With mnuXL
With .Controls.Add(Type:=msoControlButton,
temporary:=True)
.Caption = "&XLHelp"
.OnAction = "XLHelp"
End With
End With

Set mnuXL = Nothing
End If

Set cbWSMenu = Nothing
End If
End Sub

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default xlb size and addin with custom toolbar

Sorry, I didn't remember I had a custom toolbar AND an item on Excel's
existing worksheet toolbar. I thought my custom toolbar was the issue because
I did not set it as "temporary", but it was the item I added to Excel's
worksheet toolbar.
--
Thx
MSweetG222



"Gord Dibben" wrote:

Which you were told to do October 22nd when you first posted.

From my reply to you then......................

Post your code, but I suspect you are not deleting the Toolbar when the
workbook closes.



Gord Dibben MS Excel MVP

On Mon, 27 Oct 2008 12:07:35 -0700, MSweetG222
wrote:

So I had to modify to the Auto_Close procedure to include this line of code



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to increase size of image in button (msocontrolbutton) of custom toolbar of Excel padam Excel Discussion (Misc queries) 0 August 11th 06 07:18 PM
How to increase size of image in button (msocontrolbutton) of custom toolbar of Excel 2000 [email protected] Excel Programming 0 August 8th 06 06:33 AM
how to increase size of button's image of custom toolbar of Excel Padam Excel Programming 0 August 7th 06 03:39 PM
custom toolbar buttons are saved where? Excel loads twice bymistake and all my custom toolbar buttons get gone!!! Kevin Waite Excel Programming 2 March 3rd 04 03:31 PM
Size of custom toolbar Ian[_8_] Excel Programming 0 September 25th 03 09:11 AM


All times are GMT +1. The time now is 05:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"