Microsoft is bringing Python to Excel
371–380 of 455 posts
Re: Microsoft is bringing Python to Excel
#372Re: Microsoft is bringing Python to Excel
#373Earlier quoted context omitted.
Do you _really_ think I've spent the past 10 years getting files like this and I still don't understand the reason. I didn't ask for an explanation. I asked for a fix. What are you doing here?? I can provide instructions on how to do this until the cows come home. I will still get files with these issues. Is that not obvious? Do you really think I want to examine _tens of thousands of rows_ in documents that are 100…
> Do you _really_ think I've spent the past 10 years getting files like this and I still don't understand the reason. I didn't ask for an explanation. I asked for a fix. I don’t believe you’ve been doing it that long and haven't found the fix. Apply appropriate formatting if you have long strings of numeric digits [as long as they can’t have leading zeroes] that you want stored as numbers but displayed without scient…
It's asinine Excel has this behavior with any large number. Try to work with a list of EAN/UPC codes... it'll wreck every single one every single time, unless you take significant care to guard against it via formatting, special characters that trick it into using a string, etc. Try working with a spreadsheet full of database id's... same thing. It's asinine.
By the very nature of Excel, large numbers belong as-is... ie. you're studying something and need the values. Approximations (what scientific notation gives you in the best case) are an exception to what people need nearly every time.
Re: Microsoft is bringing Python to Excel
#374I was so excited about Python in Excel, until it said "run in the cloud." There just doesn't seem to be any reason for this except to tie you into their cloud service. It feels so much like protecting me from unsafe printer ink. I'm generally a fan of MS Office products and try to give them the benefit of the doubt. Please help me think of a plausibly good reason for requiring Python to run in the cloud, that is not…
You also have people using Excel on iOS, and Android devices. This allows them to use and read Python in their spreadsheets.
Re: Microsoft is bringing Python to Excel
#375Earlier quoted context omitted.
> A colleague was joking, "I guess even Microsoft itself isn't able to manage local Python installations on Windows…" I've been waiting for Microsoft to solve package management on Windows since I played around with debian's apt 20 years. That's not snark, it seemed like Microsoft's product complexity and dedication to backwards compatibility of software would make them the ones to move software management forward. R…
> It seemed like Microsoft's product complexity and dedication to backwards compatibility of software would make them the ones to move software management forward. That's precisely why they _didn't_ go with the package manager model of software distribution. Package managers in most distros assume that everything you download via apt/dnf is a part of the operating system and integrates with whatever dependencies the…
Re: Microsoft is bringing Python to Excel
#376Earlier quoted context omitted.
Install PyWin32 module and `import win32com.client` and you can access "all the internal Excel objects and methods that VBA has access to". C:\>python Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from win32com.client import Dispatch >>> xl = Dispatch("Excel.Application") >>> xl.Visible = True…
The same with xlwings (works on macOS, too): >>> import xlwings as xw >>> wb = xw.Book() >>> sh = wb.sheets[0] >>> sh["A1"].value = "Hello World"
$xl = new-object -ComObject excel.application
$xl.Visible = $true
$wb = $xl.WorkBooks.Add()
$sh = $wb.Worksheets[1]
Register-ObjectEvent -InputObject $xl -EventName SheetChange -Action {
Write-Host "Hi"
}
Now when you change a cell in the spreadsheet GUI and press enter, the PowerShell "write-host" runs and prints the message. Another comment mentioned "using Excel as a GUI for Python" and the COM interfaces have the machinery to do that. It looks like xlWings has something like this, but may need an add-in installed in Excel to trigger Python code from Excel? https://docs.xlwings.org/en/latest/quickstart.html and https://docs.xlwings.org/en/latest/addin.html#xlwings-addinRe: Microsoft is bringing Python to Excel
#377》Python calculations run in Microsoft’s Cloud No thanks!
Re: Microsoft is bringing Python to Excel
#378I wish it wasn't solely powered only by Microsoft Cloud and could support python running locally, but regardless I think this will still be huge and single-handedly modernizes Excel by a large margin. This alone could eliminate the need for websites that just want this sort of data. I can think of a past project at a previous job I did building an analytics website used only by a handful of people internally that cou…
> This alone could eliminate the need for websites that just want this sort of data I catch flak for this all the time! Our users just want to be able to use Excel to free-form analyze their data. IT, of which I'm a part of, insists on building web apps to do that for them. They're never happy because all they wanted was Excel. I keep explaining all we have to do is build a data mart built using SQL Server, and use o…
There are two main issues my org has battled with:
1.People basically turn excel into their own mini databases which causes a support nightmare.
2. This is strongly related to 1) Data provenance is a nightmare because so many people were passing around excel spreadsheets it became very difficult to track down the source of the figures people were using. User A passed their spreadsheet to user B who modified it passed it to User C who further modified it, passed it to User d from there some figures ended up in front of a manager and now we have a problem...
It's not so much a problem with Power users those are the types of people using python (or R) it's the tier of users below that level that cause the damage with excel.
Re: Microsoft is bringing Python to Excel
#379I was so excited about Python in Excel, until it said "run in the cloud." There just doesn't seem to be any reason for this except to tie you into their cloud service. It feels so much like protecting me from unsafe printer ink. I'm generally a fan of MS Office products and try to give them the benefit of the doubt. Please help me think of a plausibly good reason for requiring Python to run in the cloud, that is not…
Probably because most users of excel don't have any experience installing and running Python which is even a pain in the ass for people that know Python lol. You also have people using Excel on iOS, and Android devices. This allows them to use and read Python in their spreadsheets.
An embedded Python is about 10 MiB. I just checked. Excel could easily have its own separate copy.
Re: Microsoft is bringing Python to Excel
#380Earlier quoted context omitted.
Probably because most users of excel don't have any experience installing and running Python which is even a pain in the ass for people that know Python lol. You also have people using Excel on iOS, and Android devices. This allows them to use and read Python in their spreadsheets.
>Probably because most users of excel don't have any experience installing and running Python which is even a pain in the ass for people that know Python lol. An embedded Python is about 10 MiB. I just checked. Excel could easily have its own separate copy.