Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default VBA Project Code

Hi All,

I have excel based tracker. All the macro part working fine.

Problem is I sent the file to all the users.

Small mistake I made in Macro part ie.,

instead of Uform.optionbutton1 = true I put that one as
Uform.optionbuttion2 = true.

I need to change only one line code in the module.

I can send new excel file ? but I am learning how to change the module
codes using macro.

Any suggestions ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA Project Code

Hi,

Try this code :

'==================
Sub test()
''''''''for example
Wbk$ = "MEFC_Dates.xla"
ModName$ = "usfParams"
Before$ = "Unload usfParams"
After$ = "Unload me"
'''''''''''''''''
ChangeCodeVBA Wbk, ModName, Before, After
End Sub

Sub ChangeCodeVBA(WbkName, ModuleName, BeforeChange, AfterChange)
Dim S$
With Workbooks(WbkName).VBProject.VBComponents(ModuleNa me).CodeModule
On Error Resume Next
S = .Lines(1, .CountOfLines)
.DeleteLines 1, .CountOfLines
On Error GoTo 0
S = Join(Split(S, BeforeChange), AfterChange)
.AddFromString S
End With
Workbooks(WbkName).Save
End Sub 'fs
'==================

FS
--
Frédéric SIGONNEAU
Modules et modèles pour Excel :
http://frederic.sigonneau.free.fr/

fi.or.jp.de a écrit :
Hi All,

I have excel based tracker. All the macro part working fine.

Problem is I sent the file to all the users.

Small mistake I made in Macro part ie.,

instead of Uform.optionbutton1 = true I put that one as
Uform.optionbuttion2 = true.

I need to change only one line code in the module.

I can send new excel file ? but I am learning how to change the module
codes using macro.

Any suggestions ?

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
vba project properties via code Tim Rush Excel Programming 3 June 9th 08 03:57 PM
Referencing Code from another project Robert[_16_] Excel Programming 1 August 28th 04 02:20 AM
can vba import code to vba project ? Mike Iacovou Excel Programming 2 July 28th 04 10:12 AM
Removing all code from a Project Stuart[_5_] Excel Programming 5 June 30th 04 12:54 AM


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