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 Excel crashes when I add VBA code programatically

I've written an XML web service to check the version of the VBA in an
Excel file against the version stored in the database. If the version
in the database is newer, the user is asked if they want to update
their file. If so, the web service returns the stored code from a
CLOB in the database and passes it to VBA as a string. After deleting
all of the lines of code in the appropriate VBA module, it writes the
new code back into the Code Module as follows:

ThisWorkbook.VBProject.VBComponents.item(sCodeName ).CodeModule.AddFromString
s

As it iterates through all of the appropriate forms, modules and
classes to update, I always get a "Microsoft Office Excel has
encountered a problem and needs to close" message...

This is working for SOME of my code. But failing consistently on
certain modules. I cannot make a distinction between the modules that
are working vs. the ones that are not.

Am I missing something? Has anyone seen anything like this? Anyone
have any ideas of what could be causing Excel to crash or want to see
more code?

Thank you in advance.

 
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
this code crashes excel. How come? Nolaughmtr Excel Programming 3 September 13th 07 05:22 PM
VBA code crashes Excel 97 - Help please! GB[_2_] Excel Programming 4 April 14th 07 07:15 AM
AddFromString Code - Excel crashes ... Why ? MichDenis Excel Programming 0 January 15th 07 05:49 PM
Simple code crashes Excel John[_60_] Excel Programming 1 October 27th 04 05:59 PM
Code in ThisWorkbook crashes Excel Pat Beck Excel Programming 6 August 25th 03 09:07 AM


All times are GMT +1. The time now is 06:02 PM.

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

About Us

"It's about Microsoft Excel"