Virgilio1 Posted January 24, 2017 Posted January 24, 2017 EPPlus is a .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx) https://epplus.codeplex.com/. I do not have the expertise to create a UDF to use the DLL. I have to use the dllopen functions () dllcall () but I do not know how to do! can you help me, thanks. sorry my bad English
robertocm Posted June 18, 2017 Posted June 18, 2017 I only can suggest a workaround base on these ideas: Here: https://github.com/dfinke/ImportExcel there's a 'PowerShell Module that wraps the .NET EPPlus DLL (included)' It is easy to generate plain text files from AutoIt (text files with the powershell extension) There's also possible to run Powershell scripts from AutoIt (if powershell is installed, of course) Let me share a link to another option, a ruby library: https://github.com/randym/axlsx . From author's description 'Axlsx is an Office Open XML Spreadsheet generator for the Ruby programming language'. I think Axlsx can be automated from AutoIt with the same steps described above. If i undestood well, a clear difference is that EPPlus can edit existing excel files (templates) and also create new files 'from zero'. Axlsx library doesn't seems to have the option of editing previous existing files (templates)
Danp2 Posted June 18, 2017 Posted June 18, 2017 Why not use the built-in Excel functions? Latest Webdriver UDF Release Webdriver Wiki FAQs
robertocm Posted June 18, 2017 Posted June 18, 2017 3 hours ago, Danp2 said: Why not use the built-in Excel functions? Excel functions requiere 'office installed on all the machines running the code in order for the Excel object to be available for use' See this for example:
Danp2 Posted June 18, 2017 Posted June 18, 2017 OIC. Didn't realize that you didn't have Office installed. There are a few active threads on using .NET from within AutoIT. However, you may have an easier time finding a solution with something else. Have you looked into another UDF library, like the one for OpenOffice? Latest Webdriver UDF Release Webdriver Wiki FAQs
robertocm Posted June 20, 2017 Posted June 20, 2017 Thanks for the idea, i agree that the OpenOffice UDF could be a better option to generate 'advanced reports' even output as .xlsx or .pdf formats. For more simple tasks, as changing a few values from a template, i think a simple alternative could be replacing text strings in the xml files. Here there's an example for image paths, but the steps would be similar for strings or numbers (article by Jan Karel Pieterse , updated version available in the author's web ) . Related to this, there is a udf for the .odt format in the german forum.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now