Word overflow when inserting bibliography
Hello,
I've got a master document with sub-documents for my thesis and I'm now trying to generate a reference list at the end. However, it's not working. Initially I got a VBA error '91' (with variable not set) -- this turned out to be due to some dodgy characters in a reference (seriously, when checking the db integrity, can't Zotero check for unusual characters?!). Sorted that reference, hit 'Insert bibliography', full of optimism... 'Run time error 6; Overflow'. Booooooooooo.
I can't believe that I have too many references or anything like that. And I have no way of counting how many I do have (Harvard referencing). Buy anyway, it's less than 65536, and I assume that Zotero can count to more than 128?!?!
Any thoughts?
I've got a master document with sub-documents for my thesis and I'm now trying to generate a reference list at the end. However, it's not working. Initially I got a VBA error '91' (with variable not set) -- this turned out to be due to some dodgy characters in a reference (seriously, when checking the db integrity, can't Zotero check for unusual characters?!). Sorted that reference, hit 'Insert bibliography', full of optimism... 'Run time error 6; Overflow'. Booooooooooo.
I can't believe that I have too many references or anything like that. And I have no way of counting how many I do have (Harvard referencing). Buy anyway, it's less than 65536, and I assume that Zotero can count to more than 128?!?!
Any thoughts?
We'll try to reproduce this and see what's going on here. We've finished completely rewritten Python-based versions of the OpenOffice and Mac Word plugins, which certainly avoid VBA issues like this, and we're doing some final testing of those. They may be ported to Word for Windows if issues like this prove too annoying to fix.
Thanks for this. I'm not quite sure what you're suggesting as a fix though?!
I know you'll be reluctant to do so, but can you be any more specific about when the Python version of the plugin is coming out? (I'm happy to beta-test it on my Mac if there's a chance it'll sort the problem!!) Or should I break the document in two, compile two separate reference lists and then merge them together?
In case it helps, the document is...
212 pages (w/o the bibliography!)
42,812 words
276,469 characters (inc. spaces)
PS: Is this a Windows problem or a general Word problem? Is it worth trying on Mac Office 2004?
I was feeling pretty smug about the conversion until I got this error.
Unlike mastuff, I only have one document (not a maser/sub-document arrangement).
I'm using Office 2007, FireFox 3. There seem to be no errors in the database.
My conversion process is now stalled as I need to check my old bibilography against the (non-existant) new one (to see if I made any errors).
Would you like a copy of the file and the zotero database?
This is a bit of show stopper.
I've not got around to testing this yet, but I'm going to try the following (I'm 95% confident (!) it'll work...)
1. Finish document *completely* (this is not a dynamic work-around, i.e. should it work, the bibliography won't be able to be updated if citations are added / removed)
2. Copy half the document into a new document; generate bibliography
3. Copy bibliography into text editor, either Notepad or Write (probably Write as it'll preserve formatting)
4. Repeat with other half of document -- append the second half of the bibliography to the first half
5. Copy the whole bibliography back into an empty Word document, select it all and sort it (Table -> Sort)
6. Chuck it back into the thesis
7. Make a brew
I imagine that'll work, but it's a bit of a faff. I had a dodgy reference in there originally so had to do the whole, split-the-document-in-half-repeatedly-whilst-trying-to-generate-bibliography faff, to isolate that. It was literally one citation, and isolating the half without that citation allowed me to generate the bibliography. The text needs to be copied out of Word as otherwise Word will keep it as fields, which it won't sort, which isn't helpful.
This error is obviously being thrown by the VBA script, which I can't see, but it'd be good to know whether just changing the data type of whichever variable is responsible made a difference? Surely it can't be that tricky to change something from an integer to a double, or whatever?! Although, having read one of Dan's other posts he seemed to imply that it was a problem with the total length of the document, but that seems unlikely, unless the problem is that a string in the macro is being filled; strings have a size limit of 65,280 characters (see link below), but if that was exceeded I'm not sure it would throw an overflow error, more likely an 'out of string space'!
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q211489
Is there any way of viewing / changing the VBA code?
Ok, sorted. I opened Zotero.dot and had a look directly at the VBA.
It is a Zotero error.
There are two variables declared as integers, when they should be long ints -- they are mTagStart and mTagEnd and they're declared at the top of 'subInsertFormattedText'. Just change the word 'Integer' to 'Long' after each of these and it's sorted.
I'm back in love with Zotero :)
I'm having a similar problem with the "run-time error '6'... overflow" message. Could someone explain what VBA is -- and what application to use to open the Zotero.dot file?
I tried to open this file (icon looks like a word document) but it is completely blank.
Is the fix described above by matstuff completely safe?
Thanks,
SR
We've made this change in SVN, and it'll be included in the new VBA version we release along with the Python versions in the near future.
Vba is visual basic for applications and is a programming language by microsoft that allows you to automate programs in their office suite.
Patching the code is, basically, safe. Anyway, just take a copy of zotero.dot before you start playing! Step by step instructions follow...
1. Shut down all instances of Word. Find zotero.dot and right click on it; choose open (default is 'New').
2. You should be faced with a blank document. Press Alt+F11 and the vba editor will appear. On the left is a component tree (?!). Expand the 'modules' node and double click on zotero.bas. A world of gobbledegook will appear in the editor to the right.
3. Click in the code and hit CTRL+F. Type in 'mTagStart' and press Find. You'll see a line of code something like 'Dim mTagStart as Integer'. Replace the word integer with 'long'. If everything's fine the 'long' will be capitalized and turn blue when you move the cursor to another line (do NOT press enter!)
4. Repeat step 3 with mTagEnd.
5. Save (CTRL+S) and quit the vba editor and Word. All done!
If anything goes wrong or you get an unexpected message just quit without saving.
Good luck. If that's not completely clear (!) let me know.
Mat
I was doing that fix from memory without checking as I went along. It's actually just 'Zotero', not 'Zotero.bas'. If you've opened Zotero.dot correctly it will definitely be there. To be more explicit on the tree, it goes...
Project (Zotero) > Modules > Zotero
If that's still not working, try my other fix...
I think its mTagStart and mTagEnd instead.
Great stuff, it worked for me too.
I have an overflow problem in OO2.4 and OO3 in Ubuntu 8.04. Although I deleted bibliography for now, the overflow problem is still there.
Windows XP. There is no zotero.dot file!!!!
I have in 2 weeks my thesis deadline!!!
I have the newest OOffice version and firefox/zotero too.
where I can fix this otherwise from integer to long??
thx in advance
ela
I have done the steps with "Alt+F11" and now I have another bad bug
see image
http://img502.imageshack.us/img502/3060/zoterooverflowafterchanbq2.gif
Update:
I changed all integers from subInsertFormattedText snd the calling subroutines to Long
1. error like above in the picture, but befor OO was broken and I have to restore the used files - bad
2. The bibliography is updated
3. the worst case is now a little bit smaller
4. changing Falso to True hadn't any effect
But here I cannot deal with that, any suggestion
update:
6. This happens only when the first new reference is inserted into my OOffice document.
cheers
ela
the problem described above after the conversion procedures are gone!
As I restarted my machine two days ago I think this has cleaned all the caches from firefox and Openoffice (I remove all temporary files during logging of from windows) and now I don't observe any problem while inserting or updating anq citation. :)
Same problem, same solution.
Fixing the zotero.dot file (both mTagStart and mTagEnd) did the trick.
Thank you all.
A big thank you to Matstuff for coming up with this solution
Bad luck! I wonder what Zotero is doing with such big numbers...? Anyway, keep on going, and try a data-type with more capacity than 'Long', namely 'Double'. Same solution, but use the word 'Double' in place of 'Integer' or 'Long'
('Long' will store up to 2,147,486,647, 'Double' will go to 1.79769313486232x10^308; basically, if you fill up a 'Double' I'll be dead impressed! Double's are there to store decimal information, but there's no reason they can't hold integers, so it *should* work!)
Good luck.
Mat
Any other idea? thanks!
but I am wondering that this still persist in 1.0.10. any chance it will be fixed in 1.0.11?!
thx!
I am having the same problem and I must run the risk of having everybody scoff at me by asking: how and where exactly can I find Zotero.dot?
I don't know anything about Visual Basic but read about it and managed to get in, only it says the Zotero project is inaccessible.
Any help will be very much appreciated. Thank you very much!
Edit: Sorry it's actually in a subfolder there, "startup" (at least for me).