Recommended Posts

Masum 0

Masum 0

I'm facing a random error, whereby the ExcelRangeRead function is storing the first letter of a string as a lowercase rather than the uppercase it is stored in Excel. This happens about 10% of the times. And only with one of the ExcelRangeRead functions below, Global $RTERuleName = _Excel_RangeRead($oWorkbook, 'CHFT Pools & RTE Rules', 'I' & $Row)

Share this post

Link to post

Share on other sites

water 1,761

water 1,761

What you get from _Excel_RangeRead is the RAW VALUE of the cell. What you see on the screen is the FORMATTED VALUE.
Make sure that there is no formatting rule on the cells setting the first letter to uppercase.

Similar Content

Hi all,
Long time lurker and now forum poster! I'm writing a relatively simple backup script for my firm that automates the copy, compression and organization of Leaver's data on one of our secured NAS systems. I personally found the best method to do this so far was to use 7zG.exe (GUI version of 7Zip which can use command-line too) and it functions quite well!
I would like to retrieve more info on whether any warnings or errors happen in 7Zip during the backup, but I can't quite get my head around the syntax and switches for reading out, it seems any adjustment I make to the RunWait call's string seems to break the backup or give unexpected repercussions! Hopefully its something silly I'm doing as I don't code very often.
Here is the working version:
; Compress the directories one by one in the zip using the listfile....
Local $iPID = RunWait(@ScriptDir & "\bin\7zG.exe a -mx" & $compressionQuality & " -v" & $compressSplitFileSize & " -wc:\temp " _
& $backupToLocation & "\" & $userDirectory & ".7z @bin\listfile.txt -x@bin\excludefile.txt", "", @SW_SHOWDEFAULT, $STDOUT_CHILD)
Ultimately I would love to switch entirely to 7za.exe (standalone) so that I can read the progress percentage, current file being uploaded and any warnings or errors could be processed and output to the AutoIT script's GUI I've created rather than jumping in and out of two applications per se.

Hi all,
I have a bit of code that works on my old Win10 PC, that fails on my new Win10 PC, and I think the only significant difference is the version of Autoit - old PC has 3.3.12, new has 3.3.14.
I couldn't find anything mentioned in the change logs though, so perhaps I'm wrong.
Anyway, the code to replicate my issue is:
Test('username', 'DOMAIN')
; THIS ERRORS:
;Test('localun', 'DOMAIN')
; THIS ERRORS:
;Test(' ', ' ')
; THIS ERRORS:
;Test('', '')
; THIS ERRORS:
;Test('localun', '')
; THIS ERRORS:
;Test('', 'DOMAIN')
Func Test($un, $dom)
$compName = 'PCNAME'
$FullName = '.'
$Description = '.'
; get the WIM object
$objWMIService = ObjGet("winmgmts:\\" & $compName & "\root\cimv2")
; get default user full name and description
$objAccount = $objWMIService.Get("Win32_UserAccount.Name='" & $un & "',Domain='" & $dom & "'")
If IsObj($objAccount) Then
$FullName = $objAccount.FullName
$Description = $objAccount.Description
EndIf
ConsoleWrite($FullName & @CRLF)
ConsoleWrite($Description & @CRLF)
Return
EndFunc
On my old PC this code will output just . and . for each of those line currently commented out. Which is fine.
On my new PC any of those commented out lines of code cause an error, and the script won't even compile.
$objAccount = $objWMIService.Get("Win32_UserAccount.Name='" & $un & "',Domain='" & $dom & "'")
$objAccount = $objWMIService^ ERROR
I'm very much a newb with the WMI stuff and objects, but it looks like the .Get property is failing when either $un or $dom aren't valid in v3.3.14, whereas in 3.3.12 the .Get would fail to return an object, which is then caught by the If statement.
Am I on track with this? Is there some new/better way to code the example so that 3.3.14 will compile it?

How would I go about writing a IF Then statement if the conrol send fails?
Run ("Notepad.exe")
WinWaitActive ("Untitled - Notepad")
ControlSend("Untitled - Notepad", "", "Edit1", ("Provider Practice Record"))
I have been running into lag alot. So my script has been missing input. I would like to be able to have it retry to put in "Provider Practice Record" if it misses.
I am assuming a if then statement is what I need but I am not sure what ControlSend will return if it tries to send to Edit1 and it is not there.
Or do I need to just add a timeout?