Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Removing macros using VBA

Hi Jgranda,

In the VBE | Tools | References | find and check the Visual Basic For
Applications Extensibility library.

---
Regards,
Norman



"jgranda" wrote in message
...
I am using the code from the pearson website but there is a case of user
error - me.

I am receiving the following error message:
"Compile error: User-defined type not defined"

The code I am using is:
Sub DeleteModule()
Dim VBComp As VBComponent
Set VBComp = ThisWorkbook.VBProject.VBComponents("Module1")
ThisWorkbook.VBProject.VBComponents.Remove VBComp
End Sub

When I run the debugger, it is highlighting the line Dim VBComp As
VBComponent.

Can someone give me advice on how to correct?

Thanks,

Joe



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Removing macros using VBA

Change this line

Dim VBComp As VBComponent

to

Dim VBComp As Object

no need for a reference then.

--

HTH

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

"jgranda" wrote in message
...
Thank you for that information regarding references. I do not have

"Visual
Basic for Applications Extensibility Library" listed. I have "Visual

Basic
for Applications" checked but there are also several other "Visual Basic

for
Applications" unchecked with no descriptions on the differences. How do I
add the Extensibility Library?

"Norman Jones" wrote:

Hi Jgranda,

In the VBE | Tools | References | find and check the Visual Basic For
Applications Extensibility library.

---
Regards,
Norman



"jgranda" wrote in message
...
I am using the code from the pearson website but there is a case of

user
error - me.

I am receiving the following error message:
"Compile error: User-defined type not defined"

The code I am using is:
Sub DeleteModule()
Dim VBComp As VBComponent
Set VBComp = ThisWorkbook.VBProject.VBComponents("Module1")
ThisWorkbook.VBProject.VBComponents.Remove VBComp
End Sub

When I run the debugger, it is highlighting the line Dim VBComp As
VBComponent.

Can someone give me advice on how to correct?

Thanks,

Joe






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Removing macros using VBA

Hi Jgranda,

The library name should be:

Microsoft Visual Basic for Applications Extensibility Library.

Note the initial Microsoft. On my system the version number is 5.3


---
Regards,
Norman



"jgranda" wrote in message
...
Thank you for that information regarding references. I do not have
"Visual
Basic for Applications Extensibility Library" listed. I have "Visual
Basic
for Applications" checked but there are also several other "Visual Basic
for
Applications" unchecked with no descriptions on the differences. How do I
add the Extensibility Library?

"Norman Jones" wrote:

Hi Jgranda,

In the VBE | Tools | References | find and check the Visual Basic For
Applications Extensibility library.

---
Regards,
Norman



"jgranda" wrote in message
...
I am using the code from the pearson website but there is a case of user
error - me.

I am receiving the following error message:
"Compile error: User-defined type not defined"

The code I am using is:
Sub DeleteModule()
Dim VBComp As VBComponent
Set VBComp = ThisWorkbook.VBProject.VBComponents("Module1")
ThisWorkbook.VBProject.VBComponents.Remove VBComp
End Sub

When I run the debugger, it is highlighting the line Dim VBComp As
VBComponent.

Can someone give me advice on how to correct?

Thanks,

Joe






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default Removing macros using VBA

?B?amdyYW5kYQ==?= wrote

Thank you for that information regarding references. I do not have
"Visual Basic for Applications Extensibility Library" listed. I have
"Visual Basic for Applications" checked but there are also several
other "Visual Basic for Applications" unchecked with no descriptions
on the differences. How do I add the Extensibility Library?


I see what you see, one at the top and several way down the list. The only
way I know I've checked the right one is to follow the path listed for
Location: under that list (path is chopped, but what you can see will get
you to the right folder). The file name you're looking for is VBE6EXT.OLB
(intuition?). If you right click on that file, click Properties and the
Version tab, you'll see:
Visual Basic for Applications Extensibility Library
(actually it's chopped, but logically couldn't be otherwise)
in the Description: field

This is using XL2000, so filename with other versions may differ (guess).
Don't know why it's showing up the way it is in References. Seems to me I
read a long time ago there was a way to fix that so the full name would
show -- too long ago to worry about now, though, if even there were a way.

--
David
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
Removing Macros Erin Excel Worksheet Functions 4 January 13th 10 01:18 PM
Removing macros from workbook Darrell Excel Discussion (Misc queries) 1 October 4th 05 03:56 AM
removing unwanted macros... melchizadek132 Excel Discussion (Misc queries) 1 June 17th 05 01:24 AM
Removing macros using VBA Frank Kabel Excel Programming 0 September 1st 04 05:07 PM
Removing Macros tina Excel Programming 2 June 21st 04 08:14 PM


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