PDA

View Full Version : Excel Crash



bruinenat
03-29-2010, 02:41 AM
Hi there

my Excel file crashes when clicked on the only visible button of the worksheet ("Klik hier om te starten").

It doesn't crash on my computer, but on the computer of 2 colleagues it does crash. I have to mention they use it on a laptop; my pc is a desktop.

We all use the same version of Excel: Excel 2003 SP3.

My computer: Win Xp; 3 Ghz; 0,99 GB RAM
One Colleague: Win Wp; 1,83 Ghz; 504 MB RAM

I already used the VBA debugger, no problems found. Could it be pc-related?
Thanks for your much appreciated help!

I had to upload to external server due to limited upload on this forum:
Links is 7 days valid from now on (monday 27 march)

http://www.yousendit.com/transfer.php?action=batch_download&batch_id=bFFQTkF1ZDVnYVB2Wmc9PQ

Thanks again

Bob Phillips
03-29-2010, 03:25 AM
I have just tried it on a laptop, and it didn't crash for me.

XP pro, 2.6GHz, 4.0 GB RAM
Excel 2003, SP3

Aussiebear
03-29-2010, 03:25 AM
Not enough information given. I for one am not prepared to open a file from someone I don't know,based on the information you have currently provided.

Please indicate what type of file is it, & what is on the sheet, what the button is supposed to do, and what you were doing when it failed.

Jan Karel Pieterse
03-29-2010, 06:54 AM
Could you describe what you mean by "crash"? Do you get a runtime or compile error, or does Excel give you the famous "Excel has experienced a problem and needs to close, we're sorry for the inconvenience" dialog?

bruinenat
03-29-2010, 07:59 AM
"Excel has experienced a problem and needs to close, we're sorry for the inconvenience" is what i get.

What does this file do?
-1- Calculate the price for print advertisments (in one or more newspapers)
-2- Make an automated MS Word document featuring ei. the prices
-3- And (if preferred) an e-mail with that MS Word document (NOT sending, make mail)

All throught input via the Wizard.

IMPORTANT PS:

It was developped to be used under the Dutch version of Excel. If the user doesn't use that version, you will get another userform.

bruinenat
03-29-2010, 08:00 AM
I might upload another version without the language check (tommorow). I didn't get any errors now after deleting the language check (for now...).

Jan Karel Pieterse
03-29-2010, 09:28 AM
I find it unusual to use a separate form for a different language, I would change the labels and such on the fly.

Maybe your project needs cleaning:
http://www.appspro.com/Utilities/CodeCleaner.htm

bruinenat
03-30-2010, 12:05 AM
I find it unusual to use a separate form for a different language, I would change the labels and such on the fly.


Hi Jan Karel & everyone else

First of all, I've uploaded a version without language check here:

http://www.yousendit.com/download/bFFPQ3Q5Q1JvQUpFQlE9PQ

1. I will try to clean my code, but unfortunatly I can't clean it here at my workplace (no admin rights). I'll try it at home.

2. I guess there is a misunderstanding here; I'll explain it better:

- I check several settings from the user - including what version of Excel is used on the computer. If the MS Excel version is different than Dutch, one gets another "alerter" userform (indicating that the excel file should be used in a dutch version of excel). If all settings are good (see my Boolean --> vwVoldaan); then the file will operate as it should.

In "Sub geldigheid"; you will find this:
********************************
If VwVoldaan = False Then
Geldig.Show
Else
RRS.Show '<------------ I guess this triggers the crash!
End If
********************************

Under RRS-userform:
********************************
Private Sub UserForm_Initialize()
Application.Run "Init"
End Sub
********************************

I uploaded a version without the language check here: (for those of you who don't have the dutch excel):

http://www.yousendit.com/download/bFFPQ3Q5Q1JvQUpFQlE9PQ

In Dutch:

Het bestand controleert eerst een aantal instellingen, waaronder of de gebruikte versie een Nederlandstalige versie is van Excel. Is dat niet het geval (vb Engels) dan zal de gebruiker een userform ("Geldig") te zien krijgen dat de gebruiker hierop wijst (i.p.v. de echte Wizard van de toepassing).

Is het een Nederlandstalige versie (en andere instellingen zijn ook goed; cfr Boolean "vwVoldaan"); dan kan de gebruiker het bestand gebruiken en zal de userform "RRS" tevoorschijn komen.

Volgens mij loopt het fout bij het tevoorschijn komen van de userform "RRS".

Hier vind je de versie zonder controle van oa. taalinstellingen:

http://www.yousendit.com/download/bFFPQ3Q5Q1JvQUpFQlE9PQ

Jan Karel Pieterse
03-30-2010, 02:50 AM
I suspect the crash may be caused by the rrs form, it has a lot of controls, maybe something has gone wrong with it.

I have a couple of tips on your code if I may.

1. You use application.run a lot, this is not needed, better to use the subroutine names directly, so instead of
application.run "Init", just use Init.

2. You have placed a lot of the initialisation code for the userform outside of the codemodule of the form, it is better to have the code that is just for the userform in the module of the userform itself.

3. Why would your application only work on Dutch Excel? That should not be needed.

bruinenat
03-30-2010, 02:59 AM
3. Why would your application only work on Dutch Excel? That should not be needed.

Thx for your advice; I'll keep that in mind!

The Dutch excel is need for the formatting of the numbers. I export the values from several TextBoxes to a MS Word document. In the English version; the comma means "thousands". The opposit for the point. Thats' actually the only reason!

In my code, you'll also find this: ".Style = "Tabelraster"" - so I should also add the English option for this. (should'nt be a problem for me though).

thx!

bruinenat
03-30-2010, 04:19 AM
1. You use application.run a lot, this is not needed, better to use the subroutine names directly, so instead of
application.run "Init", just use Init.


I deleted all "application.run" (in all modules), but it doesn't seem to work for me. Could it be you mean: use "init" (in my case) in the userform_activate (and leave application.run in the modules ontouched)?

EDIT: I renamed a subroutine, now your method works fine! Thank you!