Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
vba project properties via code | Excel Programming | |||
Referencing Code from another project | Excel Programming | |||
can vba import code to vba project ? | Excel Programming | |||
Removing all code from a Project | Excel Programming |