Search found 328 matches

by hagchr
Wed Nov 27, 2013 1:38 pm
Forum: Technical / Scripting
Topic: Removing the first character in a very large file
Replies: 5
Views: 6330

Hi, I was curious to see if one could use RegEx to solve it. Not sure if there are any upper limits when the file gets much larger but for one million lines it will complete it in around 1 second. Let>InputFile=C:\Users\Christer\Documents\testfile.txt Let>OutputFile=C:\Users\Christer\Documents\resfi...
by hagchr
Fri Nov 08, 2013 5:04 pm
Forum: The Water Cooler
Topic: Versio 8 not working. Help!!
Replies: 6
Views: 10352

In the separate> line the result will go into the variable file_names, whereas in the subsequent loop you check for the number of items of filenames (filenames_count), ie inconsistent naming of the variable.
by hagchr
Thu Nov 07, 2013 8:31 pm
Forum: General Discussion
Topic: Can MS count?
Replies: 2
Views: 5773

Another alternative could be to use RegEx. (I think the XLSheetToArray requires xls format so for new excel files you may need to save as xls) XLSheetToArray>C:\...\Your excelfile.xls,Sheet1,arr Let>tmp2= //Create a string, concatenating the relevant cells separated with commas //If column 7 contain...
by hagchr
Thu Nov 07, 2013 7:17 pm
Forum: General Discussion
Topic: Can MS count?
Replies: 2
Views: 5773

Hi, One way would be to do as you suggest, to simply loop over the relevant cells and just add up the numbers. An alternative (since there are so many powerful functions in excel) is to place a formula (in this case COUNTIF) in an empty cell to calculate the value and then bring the result back into...
by hagchr
Tue Nov 05, 2013 6:54 pm
Forum: Beginners
Topic: How to separate values
Replies: 8
Views: 9223

An alternative (for example if you have variable number of spaces between strings) would be to use RegEx

Code: Select all

Let>tmp=R74862       60009AG10C9P    0050

RegEx>[^\s]+,tmp,0,Matches,NumMatches,0,,

Let>ct=0
While>ct<NumMatches
Let>ct=ct+1
Messagemodal>Matches_%ct%
EndWhile
by hagchr
Tue Nov 05, 2013 6:06 pm
Forum: Beginners
Topic: How to separate values
Replies: 8
Views: 9223

JRL, many thanks - will help going forward.
by hagchr
Tue Nov 05, 2013 5:49 pm
Forum: Beginners
Topic: How to separate values
Replies: 8
Views: 9223

Sorry, something happened when I posted it (looked ok in preview)

Let>tmp=R74862 60009AG10C9P 0050
Separate>tmp, ,arrItems

Let>ct=0
While>ctct=ct+1
Messagemodal>arrItems_%ct%
EndWhile
by hagchr
Tue Nov 05, 2013 5:47 pm
Forum: Beginners
Topic: How to separate values
Replies: 8
Views: 9223

For example:

Let>tmp=R74862 60009AG10C9P 0050
Separate>tmp, ,arrItems

Let>ct=0
While>ctct=ct+1
MessageModal>arrItems_%ct%
EndWhile
by hagchr
Fri Nov 01, 2013 10:42 am
Forum: Beginners
Topic: Import a time from Excel
Replies: 6
Views: 7304

I was first playing with pulling also the date information and still had the date format left on (mm/dd/yy). (Admit maybe inconsistent with looking for the time but I did not think the format would affect it)
by hagchr
Fri Nov 01, 2013 10:19 am
Forum: Beginners
Topic: Import a time from Excel
Replies: 6
Views: 7304

Hi,

I get an error code if excel is formatted with one of the excel date formats. Unformatted it works well, so format seems to impact (I am using excel 2010)

Microsoft VBScript Compilation error :1006.
by hagchr
Mon Oct 07, 2013 7:30 am
Forum: Technical / Scripting
Topic: Excel Sheet Names - How to retrieve
Replies: 2
Views: 3297

Hi, I think you need to change

VBRun>GetXL(xlFile)
to
VBRun>GetXL,xlFile
by hagchr
Thu Oct 03, 2013 1:00 pm
Forum: The Water Cooler
Topic: The Unofficial Macro Scheduler Puzzler of the Week 3
Replies: 21
Views: 23643

Let>InitVal1=13.85
Let>RoundOffset=0.84
mdl>{trunc((%initval1%)-(%roundoffset%))+1}
by hagchr
Wed Oct 02, 2013 7:26 am
Forum: Technical / Scripting
Topic: passing variable to vbscript for outlook
Replies: 3
Views: 5030

I think you need to pass the variable in the sub call (see x in VB part and extra parameter in VBRun call). VBSTART Sub SendOutlookMail(x) Set objOutlook = CreateObject("Outlook.Application") Set objMailItem = objOutlook.CreateItem(0) ' // Option Values for Outlook Object CreateItem( ) are: ' // 0=M...
by hagchr
Mon Sep 30, 2013 3:29 pm
Forum: Technical / Scripting
Topic: Cannot click ENTER on pop-up box
Replies: 5
Views: 6818

Sometimes I have had problems with hidden windows confusing my script. Then I try to look for visible windows only by adding Let>WF_TYPE=2 before the SetFocus. Not sure if the issue here, but maybe worth trying, also adding a wait before the ENTER. Let>WF_TYPE=2 SetFocus>Question -- Webpage Dialog* ...
by hagchr
Sat Sep 21, 2013 10:24 am
Forum: The Water Cooler
Topic: The Unofficial Macro Scheduler Puzzler of the Week 2
Replies: 5
Views: 9250

The variable r is used twice (repeat counter and result of WriteLn) and gets reset to zero in the loop. This leads to a loop doing the same thing each time.
Sign up to our newsletter for free automation tips, tricks & discounts