PC Review


Reply
Thread Tools Rate Thread

Coding to remove and import Module

 
 
mathieu936@gmail.com
Guest
Posts: n/a
 
      17th Sep 2007
Hi!

I would like to remove a VB module and import an other one each time I
open my excel file. Thus I need the code to put in my Sub Auto_Open()
to remove and import a module.

I just hope these codes exist!

 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      17th Sep 2007
Try something like

Sub Auto_Open()
On Error Resume Next
With ThisWorkbook.VBProject.VBComponents
.Remove .Item("modToReplace")
.Import Filename:="C:\Test\modToReplace.bas"
End With
End Sub

See www.cpearson.com/Excel/VBE.aspx for much more information about working
with the objects in the VBA Editor.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi!
>
> I would like to remove a VB module and import an other one each time I
> open my excel file. Thus I need the code to put in my Sub Auto_Open()
> to remove and import a module.
>
> I just hope these codes exist!
>


 
Reply With Quote
 
mathieu936@gmail.com
Guest
Posts: n/a
 
      17th Sep 2007
Excellent! Works great! Thanks!

Now I have text in a Notepad document and I would like it to be copied
in a cell once the module is copied. Which code can I use to do this?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add New Module through coding =?Utf-8?B?a3Jpcw==?= Microsoft Excel Programming 2 19th Nov 2007 10:47 AM
Replacing a module by coding in VBA mathieu936@gmail.com Microsoft Excel Programming 0 19th Sep 2007 04:38 PM
module coding in query =?Utf-8?B?UnVzcw==?= Microsoft Access Queries 1 1st Jul 2006 12:19 PM
forms coding to module (Urgent) =?Utf-8?B?SWFuIEI=?= Microsoft Access Form Coding 2 11th Aug 2005 03:46 PM
Module coding Lurch Microsoft Access Forms 2 26th Mar 2004 02:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:36 AM.