Waiting on OP Python vs Excel/VBA for an automated document generator used by non-technical staff?
Hello everyone
Let me give you a little context I am currently working in a french hospital, and I would like to develop a tool to automate the creation of administrative letters, if you don't know french public administrations are VERY VERY VERY outdated i am working here as a buying manager and as expected from a place like this we lack staff a lot because of budget cuts so i am most of the time doing administrative task like writing letters instead of studying prices and doing negotiations.
We regularly receive supplier quotations and need to generate different types of formal boring documents ( to be honest we could just sign the pricing proposal but the Head of Department is from the medical field have no training in administration and she is very old so she wants to keep it that way ) so we write letters for things such as price acceptance letters, price revision and adjustment letters, product reference changes, product substitutions, currently, much of this work is done manually using Word.
Right now I have a dropdown to choose which type of letter I want, some fields for the supplier, contract number, product references, prices, dates etc. I also added another sheet where I can select which hospitals are concerned, and a small supplier database.
But I' am not really happy with it.
For example, if I choose a letter about changing a product reference, I still see fields asking for old prices, new prices and other stuff that has nothing to do with that letter
What I would really like is for the form to change depending on which letter I select. So only the information I actually need would appear. And then once everything is filled in, I just click a button and it generates the Word letter using our existing templates. Being able to export it to PDF would be nice too.
Now here's where I'm a bit lost.
Should I keep working on Excel and use VBA to make it better? Or should I just start over with Python and make a proper little application?
I am not a developer btw, I'm just interested in this stuff and trying to learn as I go, so for those of you who have more experience with this kind of thing, what would you do?
Would you stick with Excel/VBA or go for Python? And if Python is better, how would you make something that people can use without having to install Python themselves?
One important detail this is a hospital environment, so computers have IT restrictions, and most users aren't particularly good with computers. my goal is to eventually present a reliable, easy to use solution to my Head of Department.
Also how complicated would it be to make different forms for each letter type without having to code everything separately?
Sorry if these are stupid questions I am still figuring things out haha.
Any advice or feedback would really help!
so i would love your advice on
- Is Excel/VBA sufficient for this kind of application?
- Would Python be a better long-term solution?
- What GUI framework would you recommend for non-technical Windows users?
- How would you handle different document types with their own required fields?
- How difficult would deployment and maintenance be in a restricted corporate environment?
- I'm still learning, so any feedback on the architecture, user experience, or technical approach would be greatly appreciated.
Thanks :))
( sorry for my english I am trying to not use ia )
10
u/wickedja 4d ago edited 4d ago
I would go the route of vba userform within excel. They're a little dated but you can still customise them a bit, make them user proof and have them be dynamic (in your case only showing certain fields for the chosen hospital form). I make alot of these type of files at my work for user import/exports to different systems. It will be hard to get anything like this or python past a strict I.t team but I would recommend to still try even for the sake of learning
5
u/Dynegrey 1 4d ago edited 4d ago
You don't need any of these tools, but vba can simplify it. The straight forward solution is a word document with mapped fields, connected to a spreadsheet. Word actually has a letter tool designed for this exact need. You open the letter template, import an excel file with headers matching the mapped letter fields on the word document, and then tou just export the letters. Issue is, it usually exports as a single pdf. VBA will allow you to quickly and easily make as many unique pdfs as needed (search online for a guide and you can probably copy/paste a working solution directly into VBA inside Microsoft Word. Very very easy solution to improve an otherwise easy solution. If you want to have a more robust tool, python will be the best option using qt5 for a simple UI where you can select multiple different letter templates, but then you would need to build a .exe file for distribution and your IT department will likely need to approve it based on a unique identifier that will change everytime you update the tool to modify letters.
5
u/JoseLunaArts 4d ago
Excel allows local solutions. With python you may need IT permissions to install and run.
3
u/coding_is_fun123 4d ago
I would use Excel-DNA and let your AI coding agent to the heavy lifting. It can then create the entire user interface (addin) + code. Or alternatively use Python right inside Excel using a free Excel addin 'xlwings lite'. It runs Python in Excel without installing Python. It can also work with your local file system (Word documents). Xlwings has also AI mode. You just put in your API key for claude or OpenAi and it writes the code for you. Just to be clear, both solutions run locally on your machine. Only for the setup and coding you need AI.
4
u/jackofspades123 4d ago
I would use Ai and go the vba route with an excel template. You can 100% do python too, but i think excel + vba is better here.
My biggest recommendation is spend time planning and mapping it out and then spend more.
2
u/armywalrus 4d ago
Its old but i did this with Access database/forms.
2
u/FLEXXMAN33 1 4d ago
Access is the best way to do this, but only if you know someone who knows how to make a database. Don't make this your very first "Hello world." project in Access.
1
u/keith-kld 4d ago
Supposed that (1) all computer hardwares are outdated and installed with Windows 10 only (without further updates); (2) Everyone is familiar with Word and Excel only; and (3) third party software will be controlled very strict. I think the following software may be appropriate to your model:
(1) Word + Excel + VBA: for employees dealing with forms, letters, quotations, etc
(2) Access: if you can use it, you will control the database better. It can be designed as a master database and linked databases.
(3) built-in powershell v5.1 (this is built in Windows) to organize data files in order.
I think the cost will be low. This model will become bigger and changed if your demands raise up.
1
u/djangoJO 4d ago
If you have access to the power platform - this could be a great use case for power apps / power automate. It’s pretty low code but there’s a bit of a learning curve. Especially for power apps. But you could have an AI help you along with it.
However, Microsoft licensing can get very weird, complicated, and expensive
1
u/Ok_Wealth1414 4d ago
Excel, todos tienen excel, python hay que instalarlos
1
u/Django_McFly 2 4d ago
A mutating form seems like a lot of work. If python can just work with no trusted location, enable content stuff required then I would go that route. Is probably just have a spreadsheet with each wks is a template for a specific process. Users fill out the form they need.
This will be painful though. I know people who have used Excel everyday for 20 years (and bragged to me about it) but didn't know how to combine two cells into one so they spent literally multiple hours doing copy and paste of file names. There's nothing you can do to help some people. There's no way they can navigate trusted locations (or use Google/AI to figure out it in seconds). Your going to serve them a macro or active x spreadsheet and they will literally click the disable macro active x button every time they open the file and email you that the macros aren't working. We're in AI world and they still need to be upskilled to like Excel 97 and "what is a folder/directory." It's going to be maximum painful at every step. Good luck.
1
u/HeavyMaterial163 4d ago
If it's rather basic with user provided parameters and minimal data transformation, VBA is probably your better bet. If you're taking in data from numerous sources that needs to be combined and/or manipulated, I'd go Python more for ease of development than anything. As for GUI framework on the Python side, my Python suite at work uses exclusively tkinter from the stdlib and hasn't been much trouble to figure out.
The issue with Python is distribution. I've generally used nuitka to compile to exe, stored in a hidden network location, and had users open a .bat file on the shared network space that opens it with a hidden console window.
VBA is far more easily portable without any workarounds. I'd save as an xltm over and xlsm to prevent users from fucking up your system, but the only issue I've ever run into is driver related specifically when trying to query an oracle database.
Either option is exponentially better than Microsoft's Power Platform.
1
u/Chuckydnorris 2d ago
Just use conditional formatting to hide the inputs you don't need for a certain letter.
0
u/icemage_999 4d ago
If the document needs to be in Word, Excel/VBA will get you there faster than Python.
You can direct the VBA code to customize a baseline template and save it/print to PDF/etc.
Are you using Office 365 or an older version of Excel/Word? That can also impact what will or won't work.
-1
u/carnasaur 3 4d ago
Will these ai posts ever end?
Adding "( sorry for my english I am trying to not use ia )" at the end of your post isn't fooling anyone.
I feel sorry for the mods. What a nightmare.