Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
this code crashes excel. How come? | Excel Programming | |||
VBA code crashes Excel 97 - Help please! | Excel Programming | |||
AddFromString Code - Excel crashes ... Why ? | Excel Programming | |||
Simple code crashes Excel | Excel Programming | |||
Code in ThisWorkbook crashes Excel | Excel Programming |