Excel Tutorials and XL Function library

Helpful script writing tricks and HowTo's
Jakson
Posts: 47
Joined: 25 Jun 2021, 15:19

Re: Excel Tutorials and XL Function library

Post by Jakson » 27 Apr 2022, 18:13

Man, this is really useful! I was struggling for about the course of a day trying to cobble together some basic Excel functions like opening and activating a workbook, binding to a workbook, alternating through worksheets, getting the last used cell in a column... The last issue I had just overcome before stumbling upon this again was causing Excel to spit out the displayed text and not the stored text in a cell.

Particularly I needed Excel to hold onto a date formatted for 10 digits(IE "01/22/2023") or 8 digits (IE "01222023"). Excel has some formatting features that got my date strings looking right on the cell, but not when it came time to copy the content into a var and pass that to a website. The date string would go from 8 digit formatting to short date formatting(IE "10/2/22") which is not what I want. After reading over another post on this same forum I discovered another user had taken advantage of the .Text property of the cells they were working with.

I changed my command from

Code: Select all

range("A1").Value
to

Code: Select all

range("A1").Text
and now I can properly retrieve my 8 digit dates!!

I've been struggling with this tidbit of an issue for the better half of two hours now.

Thank you very much, @Joe Glines

perfect1151986
Posts: 13
Joined: 30 Mar 2022, 21:06

Re: Excel Tutorials and XL Function library

Post by perfect1151986 » 26 May 2022, 04:52

Hi Joe
I cant connect XL library. Help me
Attachments
12.png
12.png (99.05 KiB) Viewed 1737 times

User avatar
boiler
Posts: 16774
Joined: 21 Dec 2014, 02:44

Re: Excel Tutorials and XL Function library

Post by boiler » 29 May 2022, 07:04

When you #Include a library, the functions are already part of your script. Then to execute a function, you make a function call. You do not repeat the function definition in your script. See the documentation on Functions for further information and examples. If you still have questions about using functions after studying the documentation, please post them in a new thread in Ask For Help.

By the way, you should have at most one comma between #SingleInstance and Force.

Post Reply

Return to “Tutorials (v1)”