Jump to content
Macro Express Forums

randallc

Members
  • Posts

    434
  • Joined

  • Last visited

Posts posted by randallc

  1. Hi,

    Try "Break"; is that in version "2.0e"? [is it there?] [if you are really using such an old version, it may "break" out of any loops it finds itself in, rather than just the one you want?..... btw]

    btw, I had to go back to version "3.5d" as it broke too many macros.....

    Anyone else?

    Randall

  2. Here is the vbs version; needs only the attached macro to be imported to your library.

    // Example of Trig Function Tan (30)

    Variable Set String %T11% "Tan"

    Variable Set String %T12% "30"

    Variable Modify String: Save %T11% to Environment Variable

    Variable Modify String: Save %T12% to Environment Variable

    Macro Run: TrigFunctionVBS

    Text Box Display:

    Macro Return

    <REM2:Example of Trig Function Tan (30)><TVAR2:11:01:Tan><TVAR2:12:01:30><TMVAR2:19:11:00:000:000:TrigFunc><TMVAR2:19:12:00:000:000:degrees><MACRUN2:TrigFunctionVBS><TBOX4:T:1:CenterCenter000278000200:000:%TrigFunc%(%Degrees%)=%TrigAnswer%><MRETURN>
    Best, Randall

    TrigFunctionVBS.mxe

  3. OK,

    Save your macro by.

    1. File

    2. Export "alt-P" [export as playable macro]

    3. Name it and save (ext "mxe" comes bydefault)

    4. reply to this post.

    5. Attach [browse] yor mxe file

    6. Add to post.

    7. Submit post.

    I can see what you have got in your macro!...

     

    Best, Randall

    <DT:MM/dd/yyyy h:mm AMPMT:01:3:{P00002}{P00000}{P00000}{P00000}><TEXTTYPE:%T1%>

    Types into an area or field or notepad you have already selected [instaed of Display Box]

  4. <CLIPE><ACTIVATE2:Notepad><WSHOW:Notepad><REP3:08:000002:000001:0001:1:01:T1><IMSD:20><TEXTTYPE:<CONTROL>a><CLIPC><TVAR2:01:03:><IVAR2:01:12:1><IFVAR2:2:01:4:0><EXITREP><ENDIF><ENDREP><LAUNCHNO3:0:0112WordPad<LAUNCH:WordPad.exe><WSHOW:WordPad><CLIPP>
    Best, Randall

    PS

    Clipboard Empty

    Activate Window: "Notepad"

    Window Show: "Notepad"

    Repeat Until %T1% <> %T1%

      Delay 20 Milliseconds

      Text Type: <CONTROL>a

      Clipboard Copy

      Variable Set String %T1% from Clipboard

      Variable Set Integer %N1% from Length of Variable %T1%

      If Variable %N1% > 0

        Repeat Exit

      End If

    Repeat End

    Launch and Activate: "WordPad.exe"

    Window Show: "WordPad"

    Clipboard Paste

  5. Hi,

    Yes, you could (theoretically!) use my "MEBasic [access the example macro lirary mex file from my signature links].

    You would need to add all your current macros to that library,and use the syntax as in the "Example" macros in that library ["alt-Shft-A" to run, from memory].

    however, if PGMmacro library has that function, it would be more reliable than my home-made MEBasic.

    If you don't need all the rest, you are probably better to use Joe's approach to use a vbs script for "tan" and run it.

    PM or email me if you really want to go into detail.

    Best, Randall

  6. Hi,

    That text box should format as

    Two days ago, it was;

    Monday, 21 November 2005

    starnge!

    Anyway, your format to follow Kevin's note should be;

    MM/dd/yyyy h:mm AMPM
    in the first line;

    thus;

    <DT:MM/dd/yyyy h:mm AMPMT:01:3:{P00002}{P00000}{P00000}{P00000}><TEXTTYPE:%T1%>
    Best, Randall
  7. should use the spreadsheet that contains the account numbers in the column, copy the account number and set to variable... and use that variable in the macro to process the spreadsheet
    I am not sure what you mean here; if you do not want to use my folder process, the spreadsheeewt name goes into T30 for each run of the loop;

    Best, randall

  8. Hi, I'd be interested to hear;

    1. I guess I need to know if you have the Wizard working; it may only work in 2003 as it does not in Office97 for this task; aand may not even in XP?

    [check the ExcelWiz [and attached macro] macro is imported to your libraray with the correct name (see macrorun command), and Wizard. exe is in your MEX directory]

    2. The macro I have sets T4 to the folder to process; change to the folder you wish to process

    3. ; it will process all Excel files in that folder unless they fall out of the 4 "If" criteria; change the criteria as you find necessary.

    4. Run the macro; outputs to "AnswerFile.xls" in your set directory unless you change it.

    5. The extra line for name would go like so; change the row length to be imported else it won't fit if it starts at column B; thus [A2:IU2, instead of A2:IV2] [remember the second parameter is the sheet number or name too; I have them set to "1" at present]

        // Copy From in loop  [returns a file name/ sheet number/ range to "%String_T10%"]

        Variable Set String %T1% "ExcelCopy$["%T30%","1","C","1","NoSave","A2:IU2","InVisible","NoExit","0","0"]"

        Macro Run: {_ExcelComWIZ}

        Variable Set String %T99% "%String_T10%"

        // Copy To in loop

        Variable Set String %T1% "ExcelCopyTo$["%AnswerFile%","1","B","%N1%","NoSave","%String_T10%","InVisible","NoExit","0","0"]"

        Macro Run: {_ExcelComWIZ}

        // Add FileName to column"A" on that row in AnswerFile;  in loop ; procees this string to strip out the name first (I have not done that yet;  from %T99%)

        Variable Set String %T1% "ExcelIntoCell$["%AnswerFile%","1","A","%N1%","NoSave","%T99%","InVisible","NoExit","0","0"]"

        Macro Run: {_ExcelComWIZ}

    Let me know specifically what you cannot interpret;

    N1 for the file number in the folder you are processinng [to row number in answer sheet]

    XLRowsToSheet2.mxe

  9. Hi,

    My Excel function will do that in the latest version, but I have not heard if the last one is running on your machine yet so have not posted.

    Best, Randall

    You need new ExcelComWIZ;

    And Only the "exe" in MEX directory from the zip;

    {_ExcelComWIZ}.mxe

    MEbasicWizard.zip

    // ***  Requires {_ExcelCOMWIZ} as macro imported; and Widard.exe" file in mE directory

    Variable Set %T2% to ASCII Char of 9

    Variable Modify String: Save %T2% to Environment Variable

    Set Variable %T4% to "Installation Path"

    Variable Set String %T31% "%T4%\Book2.xls"

    Variable Modify String: Save %T31% to Environment Variable

    Variable Modify String: Convert %T2% to integer %N2%

    Variable Set Integer %N1% to 1

    // Retrieve row 2 lines one  file [T30] at a time from Sheet1 [?] in Folder; append to Excel sheet

    Repeat with Folder

      // Exclude any file which is already openbed (~temp") or has no sensible row in that sheet

      If Variable %T30% contains ".xls"

        AND

      If Variable %T30% does not contain "Book2"

        AND

      If Variable %T30% does not contain "test"

        AND

      If Variable %T30% does not contain "~"

        Variable Modify String: Append %T30% to Text File

        // Copy From in loop

        Variable Set String %T1% "ExcelCopy$["%T30%","2","C","1","NoSave","A2:IV2","InVisible","NoExit","0","0"]"

        Macro Run: {_ExcelComWIZ}

        // Copy To in loop

        Variable Set String %T1% "ExcelCopyTo$["%AnswerFile%","1","A","%N1%","NoSave","%String_T10%","InVisible","NoExit","0","0"]"

        Macro Run: {_ExcelComWIZ}

        Variable Modify String: Append ".../...%T30%" to %T40%

        Variable Modify Integer: Inc (%N1%)

      End If

    Repeat End

    Variable Modify Integer: Inc (%N1%)

    Variable Set String %T1% "ExcelReadCell$["%AnswerFile%","1","A","%N1%","Save","Hi","Visible","NoExit","0","0"]"

    Macro Run: {_ExcelComWIZ}

    // Copy To AnswerFile

    Text Box Display: About to Exit

  10. Hi,

    i have a GUI add-on in my link from signature; "GUIMenu...", which was designed for Multiple chioice menu; infinite text size and background colour (not text colour at present, but certainly possible except in the list itself..) on the "changes" tab.

    If you want, I could change it for text box display only, but some time and work!

    Let me know...

    Randall

    GUICtrlCreateListViewItem.zip

    tabbed%20GUI%20choice6.JPG

  11. Hi,

    The line which detects end of spell and inserts a CRLF, ready for next line is;

          // Is this what you want before next spell starts; or ";"  ?

          Variable Set String %T3% ""%CRLF%""

    Change this to asemicolon instead?; -it means you have no endofline there; but I'm not sure how you are processing this? - presumably NOT (as I might) by using "ASCII file process"?)

          // Is this what you want before next spell starts; or ";"  ?

          Variable Set String %T3% "";""

    Hope this help, Randall

  12. Hi,

    My Excel function will do that in the next version, but I have not heard if the last one is running on your machine yet so have not posted.

    Best, Randall

    You need new ExcelComWIZ;

    And Only the "exe" in MEX directory from the zip;

    {_ExcelComWIZ}.mxe

    AddNameImportSheetExamples2

    MEbasicWizard.zip

    // Addto cell F1

    Variable Set String %T1% "ExcelAdd2Cell$["C:\Program Files\Macro Express3\Book1.xls","1","F","1","Save","10","Visible","NoExit","NotLastRow","0"]"

    Macro Run: {_ExcelComWIZ}

    Text Box Display:

    // SheetAdd============================================

    Variable Set String %T1% "ExcelSheetAdd$["C:\Program Files\Macro Express3\Book1.xls","1","F","1","Save","Hi","Visible","NoExit","LastRow","0"]"

    Macro Run: {_ExcelComWIZ}

    // GetSheetName==========================================

    Variable Set String %T1% "ExcelGetSheetName$["C:\Program Files\Macro Express3\Book1.xls","1","F","1","Save","Hi","Visible","NoExit","LastRow","0"]"

    Macro Run: {_ExcelComWIZ}

    Text Box Display:

    // NameSheet============================================

    Variable Set String %T1% "ExcelNameSheet$["C:\Program Files\Macro Express3\Book1.xls","1","F","1","Save","NewSheetNamed","Visible","NoExit","0","0"]"

    Macro Run: {_ExcelComWIZ}

    // Import CSV into Sheet======================================

    Variable Set String %T99% "*.csv"

    Variable Set String %T99% from File Name

    If File Exists "%T99%"

      Variable Set String %T1% "ExcelImport$["C:\Program Files\Macro Express3\Book1.xls","1","A","1","Save","%T99%","Visible","NoExit","0","0"]"

      Macro Run: {_ExcelComWIZ}

    End If

    // Import only a specified range from a CSV into Sheet=============

    Variable Set String %T99% "*.csv"

    Variable Set String %T99% from File Name

    If File Exists "%T99%"

      Variable Set String %T2% "%T99%///Sheet1///A1:B7"

      Variable Set String %T1% "ExcelCopyTo$["C:\Program Files\Macro Express3\Book1.xls","1","A","1","Save","%T2%","Visible","NoExit","0","0"]"

      Macro Run: {_ExcelComWIZ}

    End If

    ==========================================

    Best, Randall

  13. Hi,

    I looked at your Field doc file; my macro seems to work; just change the field names etc and retrieve what you want, or copy contents to clipboard, vars etc....let me know if not

    Best, Randall

    [PS There are so many fields, the info needs to go to an ini or text file for processing back, I would think]

  14. by the way, in relation to my presumption for it to work at present in those first few lines(that it was a tab mark), if there was more than one, you would need to replace strings of tabs until there was just a single tabl for this macro towork to come before starting it (or on each line).

     

    Alternatively, of course if they are spaces, you would need to replace a string of spaces with at least one tab before that! I hope that all works.

    Best, Randall.

    by the way, if you wish to actually "attach" part of a text file at least as an attachment, we can check whether those marks are tabs or whatever; you may be able to see in Word, for instance anyway.

  15. hi,

    This replicates the example, but I'm still not sure either if is is exactly what you want ; all now ascii-quotes including the text as a single field.

    Try it.

    Best, Randall

    // Set tab / CRLF name [i am presuming the problems are the tabs?.... if they are spaces, I'm wrong]

    Variable Set %T2% to ASCII Char of 10

    Variable Set %T3% to ASCII Char of 13

    Variable Modify String: Append %T2% to %T3%

    Variable Modify String: Save %T3% to Environment Variable

    Variable Set %T2% to ASCII Char of 9

    Variable Modify String: Save %T2% to Environment Variable

    Delete File or Files: "examplebook2.txt"

    // Whatever the file name, process line by line

    Variable Set String %T3% """

    Text File Begin Process: "examplebook.txt"

      Variable Set Integer %N1% from Length of Variable %T1%

      Variable Modify String: Copy Part of %T1% to %T2%

      // If last character not a period, then replace tabs with ";" etc

      If Variable %T2% <> "."

        OR

      If Variable %T1% contains "%TAB%"

        If Variable %T3% = "%CRLF%"

          // Is this what you want before next spell starts; or ";"  ?

          Variable Set String %T3% ""%CRLF%""

        Else

          Variable Set String %T3% """

        End If

        Replace "%T1%" with "%T3%%T1%";" in %T1%

        Replace "%TAB%" with "";"" in %T1%

        Variable Modify String: Append %T1% to Text File

        Variable Set String %T3% """

      Else

        // If last character is a period,

        Replace "%T1%" with "%T3%%T1%" in %T1%

        Variable Modify String: Append %T1% to Text File

        // CRLF, no quotes for next line at start if it remains a sentence next line

        Variable Set String %T3% "%CRLF%"

      End If

    Text File End Process

    // Add a quote at the total end

    Variable Set String %T1% """

    Variable Modify String: Append %T1% to Text File

    Program Launch: "examplebook2.txt"

    try1.mxe

×
×
  • Create New...