Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Code Module in Sheets Collection

On Jun 3, 7:25 am, "Rob Bovey" wrote:
wrote in message

...

Thanks for the solution to fix the code. Now the question is, how can
one test if a member of the sheet colleciton is an old vbacodemodule?
Do you just do a test on type with an on error continue and test the
err.description or is there a better way?


Hi Carl,

Assuming you're looping the sheets in something like the following
manner, you can use the TypeName function to check for modules. The only
time the type name "Module" will ever appear is if you've got an Excel 5/95
code module in the Sheets collection.

Dim objSheet As Object
For Each objSheet In ActiveWorkbook.Sheets
If TypeName(objSheet) = "Module" Then
MsgBox objSheet.Name & " is a legacy code module."
End If
Next objSheet

--
Rob Bovey, Excel MVP
Application Professionalshttp://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Developmenthttp://www.appspro.com/Books/Books.htm


Rob,

Thanks a million, just what I needed!

Carl
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
User-defined type collection in class module Rob[_29_] Excel Programming 2 May 31st 06 06:02 PM
code in module A to not execute a Worksheet_SelectionChange sub of another module Jack Sons Excel Discussion (Misc queries) 4 December 11th 05 11:52 PM
Run worksheet module code from workbook module? keithb Excel Programming 1 August 14th 05 04:04 AM
creating a collection of Sheets references Eric[_27_] Excel Programming 1 February 6th 05 01:20 PM
collection of sheets mark Excel Programming 6 February 2nd 05 11:38 PM


All times are GMT +1. The time now is 11:17 AM.

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"