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 |
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 |
Changing object properties permanently at runtime
Hi Nick,
I understand that, but is it possible to change a design time property at runtime? David |
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 |
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 |
All times are GMT +1. The time now is 12:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com