Hi Ehntd,
The problem is that it inserts the code from the file in the position
that the cursor was set at.
How can I a) change the cursor position
Dim oCP As CodePane
'Move the cursor to line 10
Set oCP = VBCM.CodePane
oCP.SetSelection 10,0,10,0
or b) make it insert the text
from the file in the lines that I want?
Parse the file yourself (using VBA's File I/O) and use VBCM.InsertLines
to insert each line into the module.
Regards
Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk