Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default ListBox content not saved

Hi,
I'm working with a ListBox embedded in a worksheet. I noticed that, saving
and closing the workbook, the content of my ListBox is not saved. Is there a
way to make Excel preserve the content of my ListBox?

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default ListBox content not saved

try

Private Sub Workbook_Open()

ActiveSheet.CmbBoxDay.Clear
ActiveSheet.CmbBoxDay.AddItem ("1")
ActiveSheet.CmbBoxDay.AddItem ("2")
ActiveSheet.CmbBoxDay.AddItem ("3")
ActiveSheet.CmbBoxDay.AddItem ("4")
ActiveSheet.CmbBoxDay.AddItem ("5")
ActiveSheet.CmbBoxDay.AddItem ("6")
ActiveSheet.CmbBoxDay.AddItem ("7")

End Sub

put this code in the 'ThisWorkbook' page on the VB developer enviroment. and
then save

i used a combo box but the effect is the same.

"Paolo Sardi" wrote:

Hi,
I'm working with a ListBox embedded in a worksheet. I noticed that, saving
and closing the workbook, the content of my ListBox is not saved. Is there a
way to make Excel preserve the content of my ListBox?

Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default ListBox content not saved

The default action for controls is to unload from memory all property values
upon closing which includes closing a workbook. As Noob pointed out, they
can be reloaded automatically with the workbook open event or in the
initialize event of a form where applicable. However, to reload them with
the workbook open event, they would have to be saved in a file somewhere or
be calculated from data that is saved in a file and loaded with AddItem..

"Paolo Sardi" wrote:

Hi,
I'm working with a ListBox embedded in a worksheet. I noticed that, saving
and closing the workbook, the content of my ListBox is not saved. Is there a
way to make Excel preserve the content of my ListBox?

Thank you.

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 do I recover an Excel document saved not saved as Darryl Excel Discussion (Misc queries) 6 January 5th 10 03:39 AM
Why is Referenced Workbook Saved When ActiveWorkbook is Saved? RyanH Excel Programming 1 October 29th 08 08:20 PM
How to transpose formulas from column content to row content. Notrom Excel Worksheet Functions 1 October 12th 06 06:57 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Multi-line cell text content saved in XML Dag Johansen[_5_] Excel Programming 0 October 6th 03 10:24 AM


All times are GMT +1. The time now is 06:30 PM.

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

About Us

"It's about Microsoft Excel"