Jump to content

Recommended Posts

Posted

Did you try it with _Excel_RangeFind?
I tried $xlValues and $xlFormulas with "M(M)/D(D)/YYYY" with a german Excel but it didn't work.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted (edited)

i have not tried german, but with my example a few posts above I changed the date display to every option available including where it was words.  Such that the return of rangefind for all cells would not show the date in any kind of slash format. And it still found the target.  I dont know what the cause of that behavior is.

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Posted

I suspect that the format to be used depends on the locale.
Will test on Monday.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

i should have assumed if it was a german excel, the OS would be as well :)

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Posted

I tested with the German version of Excel 2010 (32 bit) on Windows 7 (64 bit).
The only date format that worked for me is the short date format as defined in the Windows system control. I tested the Excel search function Ctrl-f.

Will see if I can find anything on the web.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted (edited)

no not really, that is just the way it is displayed (as best as I can understand why it shows serial dates, but acts on actual dates, i havent found a way yet to search by the serial date, if that exists that would probably clear up some of the fog in my view).  You could also do it like this,   your target date needs to be month/day/year with no 0 padding.  "M(M)/D(D)/YYYY"  

edit: *maybe not needs to be, but it has worked for me even when i change the excel document to other date options that are nowhere close to this format, it apparently disregards that formatting for rangefind purposes.

 

#include<array.au3>
#include<excel.au3>

$sTarget = "7/1/2014" ;July 1 2014

$oApp = _Excel_Open(False)
$oBook = _Excel_BookOpen($oApp , @ScriptDir & "\test.xlsx" , True)
$aFind = _Excel_RangeFind($oBook , $sTarget , Default , $xlFormulas, $xlPart)
_Excel_BookClose($oBook)
_Excel_Close($oApp)

_ArrayDisplay($aFind)

 

​I tried this snippet and I'm getting errors on the UDF:

 

C:\Sources\NewTool (autoit based)\Autoit Tools\Include\Excel.au3 (622) : ==> The requested action with this object has failed.:
$oSheet = $oWorkbook.Sheets($iIndexSheets)
$oSheet = $oWorkbook^ ERROR

 

 

Is there not a way to search a specific worksheet? The reason I ask is because there are 15 tabs on the file and each tab has a date variable (the excel is a report that has daily statistics for different areas. The source file is linked to SQL server to pull the different views down then format them into a report/dashboard that gets copied to the master "dashboard" excel file).

(note edited because content was not displaying)

Edited by Jewtus
content was not displaying
Posted

Set parameter $vRange to the usedrange of the sheet you want to search.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted (edited)

Ok, so I tried this:

$sTarget = "5/21/2015" 

$oApp = _Excel_Open(True)
$oBook = _Excel_BookOpen($oApp , $fFinalFile , True)
$aFind = _Excel_RangeFind($oBook , $sTarget,"SEL!A8:AM8", Default , $xlFormulas, $xlPart)

_ArrayDisplay($aFind)
_Excel_BookClose($oBook)
_Excel_Close($oApp)

and I get the following error

"C:\Sources\NewTool (autoit based)\Autoit Tools\Include\Excel.au3" (602) : ==> The requested action with this object has failed.:
$oMatch = $vRange.Find($sSearch, Default, $iLookIn, $iLookAt, Default, Default, $bMatchcase)
$oMatch = $vRange^ ERROR

When I try it without the ", Default , $xlFormulas, $xlPart" it executes but it gets a blank result. I tried adding wildcards to the string and using various other combinations of the date (IE 2015-21-5, 2015.21.5, etc)

Edited by Jewtus
Posted

Do you run the latest beta version of AutoIt? Because with 3.3.12.0 AutoIt shouldn't crash.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted (edited)

Yea, I do run the beta (3.3.13.19). I try to do most of my stuff in the beta version to avoid regressions (which is why a lot of what I'm doing is a mix of UDFs and VB). I currently have something like 15 different tools that I've built for my work and I don't have the time to troubleshoot every issue so when the UDF acts a little weird, I tend to do the VB equivalent or extract the specific part of the UDF i need. 

 

I'll keep messing with the VB functions if its an issue with beta.

 

P.S. Turns out that using the autoit boards on chrome at work makes some content not show up... tried using palemoon browser and I'm able to see all the forum content.

Edited by Jewtus
Posted

I suggest to use the latest production version of AutoIt (3.3.12.0) because it is stable. In the beta version Jon has started to change the way COM errors are handled which - in the unfinished beta state - leads to lot of "problems".

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...