LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default excel vba- userform problem

This code will completely remove a module

Dim VBComp As VBComponent

Set VBComp = ThisWorkbook.VBProject.VBComponents("Userform1")
ThisWorkbook.VBProject.VBComponents.Remove VBComp

You need to add a reference to the Visual Basic for Applications
Extensibility library, but you probably already have that for the other
code.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"knight4 " wrote in message
...
I am working on a program that includes some vba code to create a
userform, together with associated controls, ie buttons and image
controls. This is working fine, but i now need to find a way to remove
the userform from within vba. The user form is created from data on an
excel worksheet, if the user changes the information on the worksheet
then i need to remove the userform and then recreate it so that it
picks up the latest information. Does anybody know of a way that i can
achieve this using vba? I would appreciate any ideas you may have

Many thanks

Knight4


---
Message posted from http://www.ExcelForum.com/



 
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
Userform problem? law Excel Discussion (Misc queries) 0 December 3rd 07 07:54 PM
userform problem TUNGANA KURMA RAJU Excel Discussion (Misc queries) 0 August 10th 06 04:43 AM
Excel VBA - Userform Checkbox/Textbox Problem Thunder5 Excel Programming 1 February 16th 04 02:06 PM
Userform Problem Todd Huttenstine Excel Programming 2 February 15th 04 09:54 PM
excel VBA - Userform cmd problem Zygoid Excel Programming 3 January 28th 04 03:39 PM


All times are GMT +1. The time now is 05:35 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"