LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with Importing Form Module into external xls. file

Hello all.
Using XL 2000, I have the following issue:

I created an excel program which hundreds of external offices use and
which includes a user form. I've had to change a couple of lines of
code when a button in the form is pressed. I cannot simply mail them
replacement files, so I need to be able to create a separate program I
can send which will open the file they have and modify the code now in
their system which relates to that userform and button.
Using Chip's website, I have so far what's below, which deletes the
procedure for cmdOK_Click from the frmEntryForm module in the "File1"
workbook:

Sub Delete_OKCommand_Procedure()
Dim VBCodeMod As CodeModule, StartLine As Long, HowManyLines As Long
Set VBCodeMod = Workbooks("File1").VBProject.VBComponents("frmEntr yForm").CodeModule
With VBCodeMod
StartLine = .ProcStartLine("cmdOK_Click", vbext_pk_Proc)
HowManyLines = .ProcCountLines("cmdOK_Click",
vbext_pk_Proc)
.DeleteLines StartLine, HowManyLines
End With
End Sub

So far so good.

Now I need to be able to replace the code which was just deleted with
the updated code. However, this is over 100 lines, so I can't just
insert these with quotations as Chip's website suggests. I need a way
to store the procedure in the file I'm going to email these guys and
have the program copy it over as as replacement in the file they open.
Essentially, have the procedure I have just deleted REPLACED with new
code sent in a procedure all by itself. This sounds confusing to even
type, but I think it makes sense. Please help. Thanks a bunch! Let me
know if clarification is needed

Kev.
 
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 External Data Module xlsNewbie New Users to Excel 1 June 4th 09 07:29 AM
Importing Alan Beban's code on Arrays; Importing a module or a project Steve G Excel Worksheet Functions 4 August 27th 07 04:18 PM
importing external data from changing file name nathan Links and Linking in Excel 0 April 5th 05 09:25 PM
Form.show error in module 3 GMet Excel Programming 3 September 9th 04 07:44 PM
importing a module DJ Excel Programming 1 November 10th 03 04:58 AM


All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"