Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Tony

Pages: 1 2 [3] 4 5 ... 43
31
Hi,

unfortunately I've not been able to reproduce your problem. I have tried creating a dataframe using the strings from your original post and they appear correctly in Excel. I have also tried functions taking a unicode string and returning the same string to Excel without problems.

I've attached my tests so you can see what I've tried. Can you try them and see if they work for you please?

I have included files for both Python 2 and Python 3. In both cases the Python modules are encoded in utf-8 (see the first line of the modules). For the dataframe return type I am using the pyxll_utils.pandastypes module from here: https://github.com/pyxll/pyxll-utils.

I have tested with PyXLL 3.3.1, Python 2.7 and 3.5.

Best regards,
Tony

32
Hi,

I've not come across this problem before so I will have to look into it and get back to you.

Kind regards,
Tony

33
Help and Support / Re: triggering run of VBA macro
« on: October 22, 2017, 09:15:54 PM »
Hi,

yes, you can use the Application.Run function (part of the Excel COM api) in the same way as you can from VBA. Use pyxll.xl_app to get the Excel.Application object (https://www.pyxll.com/docs/api/utils.html#pyxll.xl_app).

If you want to do this from a worksheet function (using xl_func) you will probably need to use pyxll.async_call to call it after the Excel calculation has completed (https://www.pyxll.com/docs/api/utils.html#async-call).

I hope this helps,
Tony

34
Help and Support / Re: Error while loading script with pandas
« on: October 20, 2017, 12:15:30 PM »
Yes I would expect it to fail in both, unless for some reason the ordering of the final python path was different when using pyxll (it shouldn't be).

I'll have to have a play around and see if I can reproduce this. I've never seen a problem with linking develop packages like this, but possibly it's some combination of the pyxll_utils extension loader and script I've just not come across before.

I'll let you know what I find.

cheers,
Tony

35
Help and Support / Re: Error while loading script with pandas
« on: October 20, 2017, 11:41:53 AM »
Hi,

there should be no difference in installing modules in develop mode. That particular errors looks more like an issue with ctypes than anything else. I wonder if it's finding another _ctypes package somewhere else on the pythonpath? Could it be you have one copied somewhere in your dev environment that would only be on the path when you have your module installed with the develop option?

You can now completely disable the pyxll import hook by setting "deep_reload_disable=1" in the PYXLL section of your pyxll.cfg file. It doesn't look like your problem is caused by this, but it would be worth checking.

The console window flashing up will be if something somewhere is using subprocess or multiprocessing, or otherwise starting a child python process. When you configure the executable in your pyxll.cfg change python.exe to pythonw.exe for the windowless version and that should stop that problem.

Best regards,
Tony

36
I'm marking this as solved now as I believe everything should be resolved in the latest release, but if you're still having problems please let me know.

Best regards,
Tony

37
Help and Support / Re: Error while loading script with pandas
« on: October 20, 2017, 10:42:07 AM »
Hi,

well, this is embarrassing! There was an error with the deployment of 3.3.0 and this change never actually got included, despite being in the previous beta :(

I'm very sorry for the inconvenience. I've just released a new version (3.3.1), which this time really does include the fix for this. I've tested it for the modules you've listed with the latest pandas and pytest to confirm it really is working now.

I notice you're using the pyxll_utils shortcuts and array resize features. Did you know that both of these things are now supported by PyXLL itself? They haven't been removed from pyxll_utils to avoid breaking peoples code, but you shouldn't really need them anymore.

These are the relevant pages in the docs:
https://www.pyxll.com/docs/userguide/macros.html#keyboard-shortcuts
https://www.pyxll.com/docs/userguide/udfs.html#resizing-array-formulas

Please let me know once you've had a chance to get the latest 3.3.1 release, and whether it fixes your problem or not.

Kind regards,
Tony

38
Help and Support / Re: Pxyll Functions not appearing in Excel
« on: October 11, 2017, 03:10:29 PM »
Hi,

hmm yes that does sound like there could be a problem elsewhere. It sounds like Excel is loading the pyxll.xll file from somewhere else - which could happen if you initially installed it in one location and then tried to move it somewhere else, as Excel still remembers the old location.

The easiest way to check is to go into File -> Options -> AddIns in Excel and check the full path it is using for the PyXLL pyxll.xll file. If that is not where your config file is, that'll be the problem.

If that is the problem, you will need to uninstall the old one by going to "Manage Excel Add-Ins" in the Add-Ins page you were just on and un-check PyXLL. Then close Excel and delete or rename the file Excel was using. Then restart Excel and add the one you want it to use. Deleting or renaming the old file is the easiest way to ensure that Excel doesn't pick it up again as it has a habit of remembering!

Please let me know if this solves your problem or not.

Kind regards,
Tony

39
Help and Support / Re: Pxyll Functions not appearing in Excel
« on: October 11, 2017, 09:38:15 AM »
Hi,

that all looks correct... could you set the log verbosity to "debug" and send the log file please?

Best regards,
Tony

40
Hi,

since this question was first asked, automatic array resizing has been added to PyXLL. See the following links for more information:

https://www.pyxll.com/docs/whatsnew.html#id5
https://www.pyxll.com/docs/userguide/udfs.html#resizing-array-formulas

Best regards,
Tony

41
Hi Alfredo,

I've re-visited how async_call works in the upcoming 3.3 release so that now async_call runs the callback in an Excel macro context. This means that now your retry logic should no longer be necessary, and calling back into Excel with COM from an async callback should behave more reliably.

If you're interested you can download the beta release from https://beta.pyxll.com (username pyxll, password pyxll).

Best regards,
Tony

42
Help and Support / Re: Error while loading script with pandas
« on: September 08, 2017, 10:07:40 AM »
Hi,

sorry it's been a while, but this issue has been fixed for the next release (3.3). You can download a beta version from https://beta.pyxll.com (username pyxll, password pyxll). You can see the list of changes (including this fix) here http://beta.pyxll.com/changelog.html.

If you are able to try out the beta please let me know how you get on :)

Best regards,
Tony

43
Help and Support / Re: Assign Shortcut to PageUp Key
« on: September 08, 2017, 10:05:39 AM »
Sorry that I've not updated you in a while about this, but a beta release of PyXLL 3.3 is now available from https://beta.pyxll.com (username pyxll, password pyxll) that allows you to assign a shortcut to Ctrl/Alt/Shift+PageUp.

See http://beta.pyxll.com/docs/userguide/macros.html#shortcuts for details.

The final 3.3 release will be released in the next few weeks, but in the meantime please do try out the beta and if you have any issues let me know.

Kind regards,
Tony

44
Bugs and Suggestions / Re: Freeze excel on loading
« on: September 01, 2017, 08:34:20 AM »
Hi,

I've not come across that issue before, and so I don't know whether it would only affect the built in evaluation license or not... I'll email you a trial license key so you can see.

However, I would like to understand more about what's happening in case it's affecting other users too. Could you set your log level to debug in your pyxll.cfg file and send me the complete log please? See https://www.pyxll.com/docs/userguide/config.html#logging for details of how to change the logging settings.

Best regards,
Tony

45
General Discussion / Re: Setting the format of a cell from pyxll
« on: August 22, 2017, 10:14:38 AM »
Hi,

yes, you can use the Excel API to change cell styles. Get the Excel Application object using pyxll.xl_app, and then you can get the range you want and change its style, eg

Code: [Select]
xl = xl_app()
r = xl.Range("A1")
r.Font.Bold = True
r.NumberFormat = "General"

You can find more details about the Excel Range object here: https://msdn.microsoft.com/en-us/vba/excel-vba/articles/range-object-excel

Note that to call back into Excel like this you will have to do it from a macro, macro equivalent function or menu function. See the automation_example (https://www.pyxll.com/docs/examples/automation.html) to see how to call back into Excel from a worksheet function.

Best regards,
Tony

Pages: 1 2 [3] 4 5 ... 43