error with Visual Basic

Bug #1034141 reported by stephen adams
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Excel2LaTeX
Confirmed
Undecided
Unassigned

Bug Description

The function worked when I initially installed it. Now, whenever i try to use the function, I get this Microsoft Visual Basic error:

Run-time error '1004':
Method 'Range' of object '_Application' failed

The window then asks me if I want to cancel or debug. If I debug, I am taken to this line:

Set AddressToRange = Application.Range(sRangeAddress)

It is highlighted in yellow. The excel2latex function still seems to work on some older spreadsheets.

Revision history for this message
stephen adams (sca2c) wrote :
  • E2L_error.xlsx Edit (10.7 KiB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
Revision history for this message
Kirill Müller (krlmlr) wrote :

Recent versions of Excel2LaTeX creates a hidden sheet to store the ranges which are to be converted. Try to delete it, the error might vanish.

Revision history for this message
stephen adams (sca2c) wrote :

I cannot find any hidden worksheets in any of my excel files.

Revision history for this message
Kirill Müller (krlmlr) wrote :

Sorry for my slow reply.

I have converted your spreadsheet to .xls format using LibreOffice. I can open your spreadsheet with Excel 2000 and convert the contents to LaTeX.

Have you tried reinstalling the add-in? Which software environment are you using?

Revision history for this message
Kirill Müller (krlmlr) wrote :
Changed in excel2latex:
status: New → Incomplete
Revision history for this message
Halvard Arntzen (halvard-arntzen) wrote :

I have run into exactly the same problem, using excel/office 2007. Tried to replace the .xla file with newer version (3.3), but nothing improved. Suggestions are more than welcome.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Excel2LaTeX because there has been no activity for 60 days.]

Changed in excel2latex:
status: Incomplete → Expired
Revision history for this message
Kirill Müller (krlmlr) wrote :

If possible, could you please send me a sample Excel file that shows the problem?

Changed in excel2latex:
status: Expired → Incomplete
Revision history for this message
roland (roland-1991) wrote :

Dear Kirill,

I am experiencing the same bug. Below I will describe the exact problems I have.

In the past I have used Excel2Latex in an excel file with success. Later I have changed my entire folder structure on my current with the result that both the excel file as the .xla file are now in another location. Since then I am experiencing problems, in the sense that I run into the following error when I use it in a new file:
Error 1004 during execution
Method Range of object_Application failed.

When I click on the button to go to the code in debugging mode I get sent here:

Public Function AddressToRange(ByVal sRangeAddress As String) As Range
    Set AddressToRange = Nothing
    If sRangeAddress = "" Then Exit Function
    Set AddressToRange = Application.Range(sRangeAddress)
End Function

For some reason sRangeAddress contains the name of the tab in the old excel file I used Excel2Latex in. Then it got interesting:
I openend this old excel file (not in the same location as it was then) and tried whether Excel2Latex worked there. This was the case. It also worked in the other tabs of that file. But as soon as I did that sRangeAddress fixed to this new tab name in the debugging when I run Excel2Latex in my current file.
What stunned me even more was that when I change the tab name in my current file to the exact same as is currently in sRangeAddress, it worked!!!

Summarizing, for some reason it does not reset the range, in particular the tab name. Can you fix this bug?

I have already tried, without success, multiple times to delete Excel2Latex from my computer, and from Excel Add-Ins. Even deleted it from the ribbon in excel, which is not standardly done when deleting it from the Add-ins. Installed new downloaded version. All without success.

Some additional information:
- I am using Excel 2007.
- In the attachment I have added the complete call stack.
- There are no hidden sheets (that are not my own) in either the old nor the new excel file.
- It also does not work on excel files created on other computers.
- I do not remember my exact previous folder structure, so I cannot recreate it to test it.

I hope you can help me to fix this problem.

Kind regards.

Roland

Revision history for this message
Kirill Müller (krlmlr) wrote :

Roland

Thanks a lot for your input. The call stack really helps.

Could you please scan your registry under HKEY_CURRENT_USER, there presumably under "Software/VB and VBA program settings", for anything named Excel2LaTeX? The add-in should work again if you delete that hive, but I'd be really interested in the contents.

Revision history for this message
Kirill Müller (krlmlr) wrote :

Also, after scanning the code, now I see that it is really sensitive to a VBA setting concerning handling of debugging errors. See the first tip in http://www.techrepublic.com/blog/five-apps/five-tips-for-handling-errors-in-vba/, it should really be "Break on unhandled errors" or whatever the translation is.

Revision history for this message
roland (roland-1991) wrote :

Kirill,

This is under my registry: see attachment. Indeed deleting it, fixes the problem. Thanks a lot!

Kirill Müller (krlmlr)
Changed in excel2latex:
status: Incomplete → Confirmed
Revision history for this message
Kirill Müller (krlmlr) wrote :

Need to change code so that it's not sensitive to the setting "Break on unhandled errors" anymore.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.