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: 17
Default .insertlines automation error excel crash

Hi,
I'm having a quite strange problem in a VBA macro that I made that is
driving me crazy. First of all, I am using Excel 2003.
Well, when I try to insert lines of code in vba worksheet "sheet1", I always
get an Automation Error that causes the restart of excel.
The precise error is:
"Automation Error. connection to type library or object library for remote
process has been lost. Press OK for dialog ot remove reference."


The error always happens at the SECOND insertline instruction (the first
line in sheet1 is written correctly) in the following code:

----...----

Set VBCodeModmej =
ActiveWorkbook.VBProject.VBComponents(ActiveWorkbo ok.Worksheets("Sheet1").CodeName).CodeModule
VBCodeModmej.InsertLines 1, "Private Sub Worksheet_SelectionChange(ByVal
Target As Range) "
VBCodeModmej.InsertLines 2, "Dim Touched As Range"
VBCodeModmej.InsertLines 3, "Dim void As String"
etc etc

---...---


Note that with Office 2007 this never happens ...!

I tried the following things, read here and there for the network (I tried
them one at a time ...):
-Put option explicit: useless
-Put on error resume next: useless
-Put Instead of 'private sub' the string 'sub': useless
-Put Application.EnableEvents = True: useless
-Put Application.OnTime Now + TimeValue("00:00:10") before the Set line:
useless


Can you help me somehow?

Thank you so much right now


Mark
 
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
Excel COM Automation crash HÃ¥kan Excel Programming 0 March 14th 06 03:51 PM
Office SP2 update causes Excel automation crash! Rob Schripsema Excel Programming 4 February 28th 06 12:16 AM
InsertLines and AddFromString crash excel Chip R. Excel Programming 1 August 13th 04 03:28 PM
Excel crash error code Ed[_17_] Excel Programming 1 February 16th 04 10:46 AM
VBA Compiler Error Cause Excel to Crash MWE[_12_] Excel Programming 3 January 26th 04 02:22 AM


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