Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Replace module with code


I want to replace a current module in a workbook with a updated module
of th same name. More or less like a patch. Can this be done using
code. I've looked through the threads and do not see anything that
directly relates to using code to replace the module.
M


--
Michael Wise
------------------------------------------------------------------------
Michael Wise's Profile: http://www.excelforum.com/member.php...fo&userid=6998
View this thread: http://www.excelforum.com/showthread...hreadid=571347

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Replace module with code

Hi Michael,

See Chip Pearson's programming to the VBE page at:

http://www.cpearson.com/excel/vbe.htm


---
Regards,
Norman



"Michael Wise"
wrote in message
news:Michael.Wise.2cj543_1155558608.2199@excelforu m-nospam.com...

I want to replace a current module in a workbook with a updated module
of th same name. More or less like a patch. Can this be done using
code. I've looked through the threads and do not see anything that
directly relates to using code to replace the module.
M


--
Michael Wise
------------------------------------------------------------------------
Michael Wise's Profile:
http://www.excelforum.com/member.php...fo&userid=6998
View this thread: http://www.excelforum.com/showthread...hreadid=571347



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Replace module with code

'----------------------------------------------------------------
Function UpdateModule()
'----------------------------------------------------------------
Dim vbMod As Object

Set vbMod = ThisWorkbook.VBProject.VBComponents("mTest")
ThisWorkbook.VBProject.VBComponents.Remove vbMod

ThisWorkbook.VBProject.VBComponents.Import _
Filename:="C:\mTest.bas"

End Function


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Michael Wise"
wrote in message
news:Michael.Wise.2cj543_1155558608.2199@excelforu m-nospam.com...

I want to replace a current module in a workbook with a updated module
of th same name. More or less like a patch. Can this be done using
code. I've looked through the threads and do not see anything that
directly relates to using code to replace the module.
M


--
Michael Wise
------------------------------------------------------------------------
Michael Wise's Profile:

http://www.excelforum.com/member.php...fo&userid=6998
View this thread: http://www.excelforum.com/showthread...hreadid=571347



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Replace module with code

Also, include this at the start of the code module

Const vbext_pk_Proc = 0


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Michael Wise"
wrote in message
news:Michael.Wise.2cj543_1155558608.2199@excelforu m-nospam.com...

I want to replace a current module in a workbook with a updated module
of th same name. More or less like a patch. Can this be done using
code. I've looked through the threads and do not see anything that
directly relates to using code to replace the module.
M


--
Michael Wise
------------------------------------------------------------------------
Michael Wise's Profile:

http://www.excelforum.com/member.php...fo&userid=6998
View this thread: http://www.excelforum.com/showthread...hreadid=571347



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Replace module with code

that site is helpful. i used it to create a single checkbox on a form, i use for
a menu, to toggle auto open on and of.



--


Gary


"Norman Jones" wrote in message
...
Hi Michael,

See Chip Pearson's programming to the VBE page at:

http://www.cpearson.com/excel/vbe.htm


---
Regards,
Norman



"Michael Wise"
wrote in message
news:Michael.Wise.2cj543_1155558608.2199@excelforu m-nospam.com...

I want to replace a current module in a workbook with a updated module
of th same name. More or less like a patch. Can this be done using
code. I've looked through the threads and do not see anything that
directly relates to using code to replace the module.
M


--
Michael Wise
------------------------------------------------------------------------
Michael Wise's Profile:
http://www.excelforum.com/member.php...fo&userid=6998
View this thread: http://www.excelforum.com/showthread...hreadid=571347







  #6   Report Post  
Posted to microsoft.public.excel.programming
KR KR is offline
external usenet poster
 
Posts: 11
Default Replace module with code

Bob- I realize this is an old thread, but I'm catching up- I've had trouble
using code to update modules (an ongoing task) and I haven't seen this line
of code before. What does it do?
Thanks!
Keith

"Bob Phillips" wrote in message
...
Also, include this at the start of the code module

Const vbext_pk_Proc = 0


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Michael Wise"
wrote in message
news:Michael.Wise.2cj543_1155558608.2199@excelforu m-nospam.com...

I want to replace a current module in a workbook with a updated module
of th same name. More or less like a patch. Can this be done using
code. I've looked through the threads and do not see anything that
directly relates to using code to replace the module.
M


--
Michael Wise
------------------------------------------------------------------------
Michael Wise's Profile:

http://www.excelforum.com/member.php...fo&userid=6998
View this thread:

http://www.excelforum.com/showthread...hreadid=571347





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
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
copying vba code to a standard code module 1vagrowr Excel Discussion (Misc queries) 2 November 23rd 05 04:00 PM
Run worksheet module code from workbook module? keithb Excel Programming 1 August 14th 05 04:04 AM
Macro to replace a VBA module? mrl[_2_] Excel Programming 3 August 5th 05 09:08 PM
Create a newworksheet with VBA code and put VBA code in the new worksheet module ceshelman Excel Programming 4 June 15th 05 04:37 PM


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