Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Compiled Application Crashes

Symptom: Compiled application crashes while same uncompiled
application works OK.
Platform: XL 2003 on winXP

I have an XL application with about 150 Subs and 1500 lines of code.
All the subs are accessed via a custom CommandBar, created by code.
It has been working fine for a long time.

Recently, I made a small update, involving some cells and just one
sub. I compiled and saved the application.
The application started crashing, when another sub was called - not
the modified one.

To my surprise, I discovered, that if I saved the application without
compiling it, it works!

I tried VBA Code Cleaner, and same pattern persists. The compiled
version crashes while the uncompiled version works.

Any idea?


Thanks
Dovy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Compiled Application Crashes

There is very little benefit to compiling code in VBA. Normally compiled code
will run faster but not in VBA. What compiling does however is it increases
the file size. So your compiled file will take longer to load since it is
marginally larger but it will not run any faster. Take a look at this site
where you can get a decomipler utility...

http://cpap.com.br/orlando/VBADecompilerMore.asp
--
HTH...

Jim Thomlinson


" wrote:

Symptom: Compiled application crashes while same uncompiled
application works OK.
Platform: XL 2003 on winXP

I have an XL application with about 150 Subs and 1500 lines of code.
All the subs are accessed via a custom CommandBar, created by code.
It has been working fine for a long time.

Recently, I made a small update, involving some cells and just one
sub. I compiled and saved the application.
The application started crashing, when another sub was called - not
the modified one.

To my surprise, I discovered, that if I saved the application without
compiling it, it works!

I tried VBA Code Cleaner, and same pattern persists. The compiled
version crashes while the uncompiled version works.

Any idea?


Thanks
Dovy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Compiled Application Crashes

On Jan 9, 6:24*pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
There is very little benefit to compiling code in VBA. Normally compiled code
will run faster but not in VBA. What compiling does however is it increases
the file size. So your compiled file will take longer to load since it is
marginally larger but it will not run any faster. Take a look at this site
where you can get a decomipler utility...

http://cpap.com.br/orlando/VBADecompilerMore.asp
--
HTH...

Jim Thomlinson



" wrote:
Symptom: Compiled application crashes while same uncompiled
application works OK.
Platform: XL 2003 on winXP


I have an XL application with about 150 Subs and 1500 lines of code.
All the subs are accessed via a custom CommandBar, created by code.
It has been working fine for a long time.


Recently, I made a small update, involving some cells and just one
sub. I compiled and saved the application.
The application started crashing, when another sub was called - not
the modified one.


To my surprise, I discovered, that if I saved the application without
compiling it, it works!


I tried VBA Code Cleaner, and same pattern persists. The compiled
version crashes while the uncompiled version works.


Any idea?


Thanks
Dovy- Hide quoted text -


- Show quoted text -


Thanks Jim
I read with interest your reference, but I have another experience
which is in favor of compilation. It has nothing to do with time
saving, rather with crash avoiding.

I experienced frequent crashes with another application (350 Subs,
4000 lines of code).

The application creates custom CommandBar on Workbook_Open and cashed
often (but not always), when one of the menu items was used.
(Attempting to open a csv data file to import data).

I found an ugly workaround which eliminated the crashes: after
launching the app, I used a menu item to expose XL normal worksheet
CommandBar, than saved the app without any changes. Then I switched
back to the custom CommandBar and worked normally. This is an
application I work with on a daily basis (always on same machine), and
I had the habit of compiling after any code change. I kept following
this hated and time consuming procedure for a long time, until I
discovered by chance that sometimes, the application opened in an
uncompiled state (the compile menu item was enabled), even though I
compiled it before saving and closing.

At this point, I added the following code to Workbook_Open, and I have
not experienced one single crash ever since. (There is no more need to
re-save the app immediately after opening).

Sub Compile()

With Application.VBE.CommandBars.FindControl(ID:=578)
If .Enabled = True Then .Execute
End With

End Sub

It appears that the compiling issue in VBA has more than one aspect to
it.

Thanks
Dovy
Reply
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
Compiled data from many files Unda Excel Worksheet Functions 1 April 21st 08 08:56 PM
Excel crashes if project is not compiled (urgent help please!) Jos Vens[_2_] Excel Programming 4 March 20th 06 08:43 PM
Compiled Excel macros Tomasz Klim Excel Discussion (Misc queries) 4 October 26th 05 11:46 AM
How do I set up a Workbook with a master compiled worksheet and o. Double D Racing Excel Worksheet Functions 1 November 19th 04 06:03 AM
call VBA compiled code within vba Les[_5_] Excel Programming 1 September 26th 03 06:27 PM


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