View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Random corruption in Excel files

Mike,

Problem with the Toolbar deletion :
It is deleted then you try to make it invisible error.

Excel@Japanese Tools/Clear History without doing any entry "Divison by
zero" error :
Sub: MakeKanjiTable
Line: fontSize = CInt(Application.Height / (2 * KanjiRows))

Excel@Japanese Tools/Clear History, followed by saving OK
But upon reopening "Invalid Procedural call or argument
Sub: MakeWord
Line: Set MakeWord = New Word
Looking at you Word class, then causes Excel to crash.

Not sure if your use of Word as a class name is confusing VBA with
Word.Application.
Your could change it something else.

NickHK

"mps" wrote in message
...
Hey Nick,
It compiles without errors now and removes the toolbar, but still
intermittently crashes Excel. I have uploaded
http://www.japaneselearningtools.com/crash2.zip. On my machine, choosing
Excel@Japanese Tools/Clear History, followed by saving, crashes Excel.

Do you see anything else?

Thanks so much for all your help,

Mike

"NickHK" wrote:

Mike,
1. For one thing, allWords(i).CharRows returns an array of CharRow
objects. But your variable CharRows is an array of Integers.
Also, to use array assignment like this, use
Dim CharRows As Variant
For i = 1 To UBound(allWords)
CharRows = allWords(i).CharRows

It maybe better not to use CharRows as the name of the variable, to

avoid
confusion with the CharRows property of allWords.

2. To me that toolbar is useless without the WB. You install it so

it's
you responsibility to remove it.
Probably in the Workbook_Close event.
Application.CommandBars("Excel@Japanese Toolbar").Delete

NickHK

"mps" wrote in message
...
Hi Nick,
Thanks for suggesting Debug/Compile VBA Project. Very useful.

A couple of questions from what it shows:

1. I can't figure out why I'm getting the "Can't Assign to Array"

error
because the array I'm assigning to is resizable, which is supposed to

be
OK.
Can you look at that?

2. I didn't realize that I should remove the attached toolbar.

When/how/why
should I do that?

Thanks so much,

Mike

"NickHK" wrote:


I have noticed you are not removing the Toolbar you install upon

opening.

Excel XP & Excel 2000:
This version now gives Update Links request upon opening
Opening this version does not crash Excel, but if I drag the

floating
toolbar around, I "erase" the visible cell and see the cell

"underneath".
The tabs are indicating "Words" is the activesheet, but it is 'All

Kanji"
that is "visible" and erased. After a save and reopen, this does not

happen
again.

After a test via "Start Test", saving does not crash, but errors on

the
SaveTest routine with sub/function not found for "correctWords".

I have noticed you have numerous basic error :
Missing End If
Missing End Function
Can't assign to array

These found with DebugCompile VBAProject. You should fix these

first

NickHK