jpimbert/VBAToolKit

Create Project Isn't Working for Me

Closed this issue · 5 comments

I am trying to use VBAToolKit, and it is failing at the very first step. When I try to create a new project, it seems to work (I see the created files) but I get an error message:

Error 1004 (application-defined or object-defined error) in procedure vtkCreateProject of Module Mainfunctions.

I'm not sure if it's relevant, but I'm using Excel 2013.

You're experience is interesting because :

  • it's a long time I haven't created a new project with VBAToolKit
  • I never experienced Excel 2013

I just created a new project for test with Excel 2007. With Git installed it worked fine, without Git installed there was a #3000 error fired (not #1004). So it seems there is really a problem with Excel 2013.
Could you please more precisely localize the problem :

  • set a breakpoint at the beginning of the vtkCreateProject procedure
  • click on the Create New Project button to create a new test project
  • when the program is stopped on the breakpoint, proceed step by step (main step, not detailed step) to find the instruction who jumps to the error driver.

Your message let me know there is another issue during the project creation : the thisWorkbook module is not exported to the source directory nor inserted in the module list of the _DEV Excel workbook. I will open a new issue.

It seems that the error is taking place inside the class vtkReferenceManager, in the subroutine
addConfiguration. The exact line where the error occurs is:

m_referenceSheet.Cells(1, newColumn).FormulaLocal = "=INDIRECT(ADRESSE(1;" & newColumn - nbTitleColumns + m_nbTitleColumnsInConfSheet & ";4;1;""vtkConfigurations""))"

Change "ADRESSE" for "ADDRESS" then recreate the project. It certainly was improperly created.
The function name is in French. It's a careless mistake.

Okay, I managed to get past this problem, but it required another change: the semicolons needed to be replaced by commas. I'm not sure whether that's a difference between the French and English versions of VBA, or whether they mean something different, but I got it to work by replacing the line by:

m_referenceSheet.Cells(1, newColumn).FormulaLocal = "=INDIRECT(ADDRESS(1," & newColumn - nbTitleColumns + m_nbTitleColumnsInConfSheet & ",4,1,""vtkConfigurations""))"

Yes. You're right. It's because in french the comma is the decimal separator for numbers, so it is replaced by a semicolon as a parameter separator in formulas.
Another change to perform is to replace "FormulaLocal" by "Formula" to be sure that the fix will be correct in all localizations around the world.

m_referenceSheet.Cells(1, newColumn).Formula = "=INDIRECT(ADDRESS(1," & newColumn - nbTitleColumns + m_nbTitleColumnsInConfSheet & ",4,1,""vtkConfigurations""))"