-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basic examples only work with a modification of xlpython.xlam #12
Comments
Hi Alex,
is indeed invalid on Excel 2007, but the VBA code should be written in such a way that it does not enter into that function on versions < 2010, so I do not understand why it is raising this error. (I myself use 2007 and it doesn't complain.) Could you do me a favour and tell me what the output of typing
is on your PC? Thanks, regards, Eric |
It is 12.0 |
It not clear to me why the line If nArgs > 0 And Application.Version >= 14 Then is not stopping VBA from entering into the function. Could you send me a screenshot please? |
I get that error when I try to compile the VBA project: But there is no need to compile it. I do not get the error when I run the functions from the add-in buttons: Do you confirm that you are getting the error even when running the functions from the add-in buttons? Thanks for your patience, regards, Eric. |
could it be a language setting problem? In my localized version of Excel (german version), 12.0 is usually written as 12,0 Furthermore the version number seems to be a string anyway, so I am not sure (VBA newbie) whether you can compare it to an integer. |
Excellent insight regarding the comma! Yes that is very probably the cause of the problem. It can be fixed by replacing the line If nArgs > 0 And Application.Version >= 14 Then with If nArgs > 0 And Val(Application.Version) >= 14 Then Actually you can do that string vs. int comparison in VBA, only apparently it is not clever enough to consider the globalization settings. If you confirm that it works with this modification then I will include it in the next release. |
I think I now have a broken setup and not because of the change you have recommended. I have tried to reproduce my workaround from the first post with a fresh copy of the .xlam file but that does not work (#VALUE!). I have no clue what I did to make this fail so please give me some time to fix my setup before I can give you a final confirmation. |
Ok, well if you need any more help please just ask! |
Argh! This whole comma/ point/ semicolon thing is a nightmare. I was following your example that says I have to write =DoubleSum(1,2) What I actually do need to write instead is =DoubleSum(1;2) to make it work. I would like to express my gratitude for your timely replies and coming up with a fix so quickly. I really appreciate it. Thank you very much! Cheers, |
Yes it is very irritating how the Excel syntax works differently in different locales. Often the function names change too, for example if the language is Italian the I find that for anything but the most basic uses of Excel it is best just to change the system language to US or UK English. |
However thanks very much for finding that bug with the version number! Definitely going into the next release. |
Hi!
I have just started with xlpython today and I was unable to run this example:
Excel was complaining about the following line:
I have changed it to:
... and now it works.
What is causing this and how can I avoid this situation?
I use Windows 7 and Excel 2007.
Thank you!
Best regards,
Alex
The text was updated successfully, but these errors were encountered: