Python Forum
Can Python be used as a macro language for excel, Word, etc.?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can Python be used as a macro language for excel, Word, etc.?
#3
(Aug-19-2022, 10:39 PM)Larz60+ Wrote: Yes python can be used.
please post a small excel file with output requirements, for an example.

In the mean time, you can look through excel related packages here: https://pypi.org/search/?q=excel
also look at openpyxl: https://pypi.org/project/openpyxl/
and it's doc page: https://openpyxl.readthedocs.io/en/stable/

I have attached an Excel workbook that uses a VBA function to format a time interval in the smallest units that is <= 1. Sheet 2 has the actual worksheet code. It will not work because the VBA function is in an add-in. Sheet 1 has the literal values.

The VBA function syntax is:

=FmtTime(pTime, [pDP|1], [pInUnits|"Days"])
  • pTime is the time interval to be formatted
  • pDP is the number of decimal places to return
  • pInUnits is the units of pTime

Thanks


.xlsx   Format Time.xlsx (Size: 12.84 KB / Downloads: 121)
Reply


Messages In This Thread
RE: Can Python be used as a macro language for excel, Word, etc.? - by CynthiaMoore - Aug-20-2022, 12:02 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Has Major Problems as Language Dave 13 3,828 May-20-2022, 10:12 AM
Last Post: stevendaprano
  TIOBE Index for October 2021 - Python programming language number 1! Yoriz 1 1,608 Oct-07-2021, 11:35 PM
Last Post: Larz60+
  a new language based on python Skaperen 0 1,697 Nov-04-2020, 01:54 AM
Last Post: Skaperen
  Is python an interpreted language or a compiled language? GouravDas 1 2,090 Jun-23-2020, 10:38 AM
Last Post: Gribouillis
  what programming language to learn other than python in real mass-production product? Kai 1 2,196 Apr-12-2020, 04:40 AM
Last Post: Larz60+
  Chinese coding language ‘Mulan’ found to be Python fork buran 0 1,776 Jan-22-2020, 04:30 AM
Last Post: buran
  What is the best book for in-depth Python for advanced other-language programmers? user118967 1 2,790 Jun-04-2019, 07:56 PM
Last Post: snippsat
  Coconut - A Functional Language Which Compiles to Python nilamo 2 2,792 Jan-04-2019, 12:01 AM
Last Post: micseydel
  Some Guy Today Told Me Python Isn't A Real Programming Language digitalmatic7 11 10,370 Dec-01-2017, 12:58 PM
Last Post: I_love_py

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020