#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default userforms

Is there a way to use code to remove userforms in a
workbook?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default userforms

Is there a way to use code to remove userforms in a
workbook?


See comments at start of following Sub.

HTH,
Merjet

Sub DeleteUserForms()
' 1. need to check "Microsoft Visual Basic For Applications
' Extensibility 5.3" at VBE menu Tools | References
' 2. need to check next "Trust access to Visual Basic Project"
' at Excel menu Tools | Macro | Security | Trusted Sources

Dim VBComp As VBIDE.VBComponent
Dim VBComps As VBIDE.VBComponents

Set VBComps = ThisWorkbook.VBProject.VBComponents

For Each VBComp In VBComps
If VBComp.Type = vbext_ct_MSForm Then VBComps.Remove VBComp
Next VBComp

End Sub


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
Help with Userforms Panagiotis Marantos Excel Discussion (Misc queries) 2 July 25th 06 04:26 PM
I need some help with userforms T.c.Goosen1977 Charts and Charting in Excel 0 June 30th 06 09:29 AM
I need some help with userforms T.c.Goosen1977 Excel Discussion (Misc queries) 0 June 30th 06 09:27 AM
userforms Jo[_4_] Excel Programming 2 September 17th 03 10:35 PM
userforms Dave[_27_] Excel Programming 1 August 28th 03 06:25 PM


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