Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Removing a user form with code

Hi

I have a worksheet that has a user form with some code behind the form. Is
it possible to run code from an addin worksheet that will remove that user
form and it's code?

Any help is greatly appreciated!!

Thanks,
Kimberly


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Removing a user form with code

Hi Kimberly,

Something like this should do it:

With ActiveWorkbook.VBProject
.VBComponents.Remove .VBComponents("UserForm1")
End With

You may have to modify your security settings via Tools | Macro | Security,
Trusted Sources tab, "Trust access to Visual Basic project" for it to work
at runtime.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


KimberlyC wrote:
Hi

I have a worksheet that has a user form with some code behind the
form. Is it possible to run code from an addin worksheet that will
remove that user form and it's code?

Any help is greatly appreciated!!

Thanks,
Kimberly


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
Saving & Removing VB Code from WB NoodNutt Excel Worksheet Functions 4 April 24th 10 11:56 AM
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
User Form Code mully New Users to Excel 9 May 22nd 05 07:54 PM
Automatically including the Form and Code in all the user file ssexcel[_5_] Excel Programming 3 November 13th 03 07:33 AM
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form BruceJ[_2_] Excel Programming 2 October 15th 03 05:28 PM


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