Page 2 of 2

Re: Excel Tutorials and XL Function library

Posted: 27 Apr 2022, 18:13
by Jakson
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

Re: Excel Tutorials and XL Function library

Posted: 26 May 2022, 04:52
by perfect1151986
Hi Joe
I cant connect XL library. Help me

Re: Excel Tutorials and XL Function library

Posted: 29 May 2022, 07:04
by boiler
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.