Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Coding to remove and import Module

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!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Coding to remove and import Module

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)


wrote in message
ups.com...
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!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Coding to remove and import Module

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
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
Import underscore in coding every after 2 digits Manos Excel Worksheet Functions 4 April 23rd 10 04:08 PM
Import Module [email protected] Excel Programming 0 August 7th 06 09:11 PM
Remove and Import Module Richard Excel Programming 1 September 2nd 05 09:18 AM
VBA-How to insert vba code file in a project using coding rather than manual import Excel4Engineer[_2_] Excel Programming 1 February 9th 04 05:09 PM
Import module with vba sandy98 Excel Programming 2 November 13th 03 03:18 PM


All times are GMT +1. The time now is 05:18 PM.

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"