Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Changing object properties permanently at runtime

Hi,

I'm having trouble changing the properties of objects permanently at
runtime. Specifically, I am trying to make a commandbutton visible at
runtime. This works fine, but when I reset the VBA code, the
commandbutton returns to it's state prior to running the code.

Thanks for any help anyone can give.

David

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Changing object properties permanently at runtime

David,
Yes, that is the difference in meaning between "Design Time" and "Run Time".
If you want a property to be set for the next time you open that workbook,
you need to change it the Design time.

NickHK

"Darv" wrote in message
oups.com...
Hi,

I'm having trouble changing the properties of objects permanently at
runtime. Specifically, I am trying to make a commandbutton visible at
runtime. This works fine, but when I reset the VBA code, the
commandbutton returns to it's state prior to running the code.

Thanks for any help anyone can give.

David



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Changing object properties permanently at runtime

Hi Nick,

I understand that, but is it possible to change a design time property
at runtime?

David

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Changing object properties permanently at runtime

Hi David,

Sub Test()
Dim dForm As UserForm

Set dForm = ThisWorkbook.VBProject.VBComponents("Userform1").D esigner
dForm.CommandButton2.Caption = Time

End Sub

You can't do this while Userform1 is loaded (AFAIK). Can also add/delete
controls.

(You'll need trust access to vb projects in xl2002+)

Regards,
Peter T

"Darv" wrote in message
ups.com...
Hi Nick,

I understand that, but is it possible to change a design time property
at runtime?

David



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Changing object properties permanently at runtime

Perfect thanks!


Peter T wrote:

Hi David,

Sub Test()
Dim dForm As UserForm

Set dForm = ThisWorkbook.VBProject.VBComponents("Userform1").D esigner
dForm.CommandButton2.Caption = Time

End Sub

You can't do this while Userform1 is loaded (AFAIK). Can also add/delete
controls.

(You'll need trust access to vb projects in xl2002+)

Regards,
Peter T

"Darv" wrote in message
ups.com...
Hi Nick,

I understand that, but is it possible to change a design time property
at runtime?

David


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
Permanently Changing a Toolbar Mark P[_2_] Excel Discussion (Misc queries) 7 January 23rd 09 12:58 AM
How to check Solver and Forms 2.0 Object Library permanently? yoyo2000 Excel Discussion (Misc queries) 1 September 26th 05 03:04 AM
Changing print settings permanently woodjm Excel Discussion (Misc queries) 1 August 22nd 05 06:23 PM
RUNTIME 424 OBJECT REQUIRED??? -JEFF-[_2_] Excel Programming 2 June 17th 05 01:26 PM
Changing Properties of a Range object after initial Dimensions ?? Dan Thompson Excel Programming 4 November 3rd 04 05:10 PM


All times are GMT +1. The time now is 08:16 PM.

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"