Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Crashing - Access Violation

Status
Not open for further replies.

aMember

Programmer
Jun 12, 2002
99
US
I am trying to copy code in ThisWorkbook from a source WB to
Destination WB.

Prior to this point, I delete all existing code in Destination WB 'thisworkbook'.

I do reference VB extensibility.

'This is code in a driver utility (which is not the source or destination WB)
----------------------------
Dim theCode As String
' get the lines of code to insert
theCode = GetWorkbookOpenCode
With Destination.VBProject.VBComponents("ThisWorkbook").CodeModule
NextLine = .CountOfLines + 1
.InsertLines NextLine, theCode
End With
---------------------------

Problem is, any way I have tried it, Excel 97 crashes with an access violation on
.InsertLines NextLine, theCode

Any help would be greatly appreciated.






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top