Skip to content
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

Problem with XLPMacroOptions2010 #14

Closed
EricE opened this issue Sep 8, 2014 · 4 comments
Closed

Problem with XLPMacroOptions2010 #14

EricE opened this issue Sep 8, 2014 · 4 comments

Comments

@EricE
Copy link

EricE commented Sep 8, 2014

Hi Eric,
I was getting an error in this sub when importing UDFS (in Excel 2010), "Method 'MacroOptions' of object '_Application' failed". I tracked it down to a verbose doc string; it looks like desc can only be 255 characters long. I've made the below fix and life is good:

Sub XLPMacroOptions2010(macroName As String, desc, argdescs() As String)
If Len(desc) > 255 Then
    desc = Left$(desc, 255)
End If
    Application.MacroOptions macroName, Description:=desc, ArgumentDescriptions:=argdescs
End Sub

Thanks for the good work,
Eric

@ericremoreynolds
Copy link
Owner

Excellent Eric, thanks for finding that, I was not aware of this limitation. This will go into the next release.
Regards,
Eric.

ericremoreynolds added a commit that referenced this issue Sep 29, 2014
+ Added variable arguments length UDFs
+ VBA7/64-bit `PtrSafe` bug fix in `xlpython.bas`
+ Bug fixes #12 and #14
@ozonosphere
Copy link

Hey Eric, when is the next release which will solve this problem?

I am having this issue and cannot solve it even after modifying the code in the xlam file

i appreciate it if you could get back to me

@ericremoreynolds
Copy link
Owner

Hi ozonosphere,

Actually this fix has been included in previous releases quite a long time ago: the 255 character truncation code is present in the latest release as you can see here.

Please let me know what issues you're encountering.

Regards,

Eric

@ozonosphere
Copy link

Hey Eric
Thanks for replying

I have reinstall the latest version, however, the problem still exists when I try to import the following add-in function:

from xlpython import *
import numpy as np

@xlfunc
@xlarg("array","nparray")

def GetBoostrapedNull(array,no_of_events):
    size_1d = array.size
    data_reshape_1d = np.reshape(array, size_1d)
    random_N_events = np.random.choice(data_reshape_1d,no_of_events)
    average = np.average(random_N_events)
    return average

if you could help me, that would be great.
I am using Canopy btw.
Charles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants