Jump to content
Macro Express Forums


  • Content count

  • Joined

  • Last visited

  • Days Won


terrypin last won the day on May 15 2017

terrypin had the most liked content!

Community Reputation

2 Neutral

1 Follower

About terrypin

  • Rank

Recent Profile Visitors

441 profile views
  1. Split an array

    John’s method is probably the way I’d go. This seems to work OK for me in ME Pro: // Assumes the range of cells has been selected, either manually or with additional commands. // These TextType commands are shown individually here but could probably be combined. Text Type (Simulate Keystrokes): <F5> // KB shortcut for 'Go To'. Delay: 0.1 seconds Text Type (Simulate Keystrokes): <ALT>s // Special Delay: 0.1 seconds Text Type (Simulate Keystrokes): k // Blanks Delay: 0.5 seconds Text Type (Simulate Keystrokes): <ENTER> // Apply Delay: 0.1 seconds Text Type (Simulate Keystrokes): <CONTROL>- // Delete rows Delay: 0.1 seconds Text Type (Simulate Keystrokes): <ENTER> // Apply Delay: 0.1 seconds // The compacted range can now be selected then copeid or moved to the new coulumn, manually or with additional commands. Alternatively you could try the formula I found here: https://www.myonlinetraininghub.com/excel-remove-blank-cells-from-a-range Terry, UK
  2. Beginner's question

    I assume this arises from your your project 'Program macro at random interval'. The devil is in the details, as usual. In particular, you haven't yet told us how long your macro will take to do its task: a minimum and maximum duration. That will obviously influence the design. As I mentioned, it's also possible that further simplification might be possible, depending on the sort of work your macro does.
  3. Program macro at random interval

    Hi, Interesting question, although I'll resist the temptation to put my current project aside to explore it thoroughly! Some initial thoughts: 1. Your macro 'Random' uses Activate > Schedule, with the option 'When a Specified Time has Elapsed'. Macro 'Timer' runs every M minutes, where M equals a reasonable minimum for your time range, say 5 minutes. It opens (not activates) 'Random' in the Script Editor, operating on the Activate tab to change the 'elapsed time' entry to an appropriately random value and then saving 'Random'. Hopefully (!) that will then run randomly, doing whatever you have scripted it to do, then close - awaiting further modification. 2. Explore the 'Run Macro in Variable' command. 3. Maybe we could suggest simplified methods if you can spell out the details of what the macro will do? As an obviously extreme example, if it was merely to remind you of something at random intervals ("RSI ALERT! Leave your PC keyboard for a while,") then it would be trivial.
  4. Script to perform Regex operations?

    Thanks aarons, stiil appreciate the feedback, despite the eight year delay. But as my need for regex is relatively infrequent I guess I'll stick to what I know and use either MEP itself (along the lines of Cory's example) or deploy the text in Textpad, rather than invest time learning new stuff. Lemming: Only just seen your eight year old post. If you ever see this, my apologies! Probably missed it as it was about 10 weeks after my enquiry and the automatic email prompting system failed, assuming it existed then. But my reply is probably as above . However, I have downloaded both files and when I finish a couple of pressing projects I'll experiment in case it's easier than I suspect.
  5. Wait for Text Playback - does it work?

    Thanks, appreciate all the feedback, including Kevin’s explanation. But I’m still unclear on whether using this command is a 100% reliable way to ensure that the TextType command has been fully processed? If so then it would seem to be essential, so why is it not built in to the TextType itself? In addition, and this suggests it’s not 100% reliable, why sometimes does a macro using it fail, until replaced with a delay? I sometimes also have to preface the TextType with a Keystroke Speed, experimentally adjusted. These options (Delay/Wait/Keystroke Speed) and their possible combinations can make this a surprisingly complicated task. Yet intuitively it seems to me to be a straightforward operation: simulate the fastest possible entry of text, doing nothing else until that is finished. Terry, UK
  6. I've used this command occasionally because from its description in Help it would seem to be a guarantee that my text will get entered before anything else gets processed: "This option is to be used immediately after a Text command, such as the Text Type function. Wait for Text Playback prevents the macro from continuing until all of the text has finished playing back." But I've often found it unreliable and usually resort to simple Delays and trial/error. Perhaps it's because I don't know exactly what 'playing back' means in this context? What is the experience/insight of others please?
  7. Working with Google Earth Pro?

    Thanks anyway and my condolences.
  8. Excel: macro fails consistently

    Thanks Cory. In the couple of months or so since I posted I've made a bunch of changes.The main cause of that particular problem was the sheer size of the folder containing my workbook: 320 GB and 19,000 files in 720 subfolders. When I moved it out of that (logical) location to an almost empty folder the problems were resolved. I agree about Excel and text files being useful companions. I recently speeded up a task greatly by using MEP to create and save a text file containing a list of some 50 variables I'd generated and then using VBA to import and process them.
  9. Problem pasting to PaintShop Pro

    I'm a long term user of IrfanView and agree with you fully, Cory. Still need PSP for serious editing though. So it's frustrating that PSP 8 and MEP conflict in occasional obscure ways. As mentioned up-thread, I resorted to buying PSP 2018 because of that. A month on and I finally have it opening at tolerable speed, following recent Win 10 updates. But most of my macros would need editing so I'm still using PSP 8 for now and working around the issues.
  10. Anyone here using GE Pro? It's recently become a 64-bit app. Whether it's because of that or another consequence of recent Windows 10 updates, or something else entirely, I'm unsure, but I'm getting some odd behaviour of my macros and I'd like to discuss. SORTED. (No 'message delete' option here?)
  11. Problem pasting to PaintShop Pro

    Thanks, same as my OS and version.
  12. Problem pasting to PaintShop Pro

    Thanks both. Although unfortunately I still have the problem, your posts triggered further fruitful experiment. Bottom line is that the 'freeze' of PSP 8 and ME is not indefinite. By accident (taking a brief phone call while still at my screen) I discovered that MX Pro does eventually close - after periods that varied during half a dozen subsequent tests from 55 to 150 seconds. Somewhat reminiscent of the PSP 2018 startup delays being discussed in the Corel PSP forum. @amonaghan: Are you running under Win 10? If so, what version? I just tried an equivalent mactro to yours (I'd never used a .LNK file in a Program Launch command before) but the delay remained. I tried activating by both a shortkey and in debug mode (F9). @rberg: I had tried the batch file approach, both using the Run box and Program Launch, but no joy. I've also tried a macro that clicks the PSP 8 shortcut pinned to my taskbar. During that long delay, MX Pro was unusable and unstoppable, yet CPU usage was not high. However, if I switched to my text editor or some other text target, keystrokes were very slow to apply.
  13. Problem pasting to PaintShop Pro

    No one able to test that? It would be useful to hear from users of any version of PaintShop Pro, ideally under Win 10. In growing desperation I paid for an 'upgrade' to PaintShop Pro 2018 - and greatly regret it. Like many other of its users running Windows 10, it has startup times sometimes running into minutes! So I'm stuck with being unable to use most of my PSP 8 macros because the Activate or Launch command freezes both PSP 8 and MX Pro until I close PSP 8.
  14. I think this is a bug, although I suspect it might be unique to Windows 10. In several macros I use a Sound Fie to alert me when a macro has finished. But these no longer work. Any macro with a Sound File as its last command never ends. Running man persists. In the simple example below, on closing the TBD the WAV should play for its three seconds or so and the macro should then stop. The problem remains whether or not the option 'Wait for the sound file to finish before continuing the macro' is enabled. Text Box Display: Sound File: $LEADER.WAV <TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Close this to continue.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <SOUND FILE File="C:\\Users\\terry\\Sounds\\Sound Effects\\$LEADER.WAV" Wait="TRUE" _PROMPT="0x0007"/> It's a trivial work-around (add Macro Stop) but I'd be interested to know if anyone can reproduce please?
  15. Saving to Excel in background

    Pleased to report a successful solution. I chose the text file method for my MX Pro macro, which was tedious but simple to write. Here's the first part: // Set up ******* Variable Set to ASCII Char 13 to %CR% Variable Set to ASCII Char 10 to %LF% Variable Set to ASCII Char 9 to %TAB% Variable Set String %CRLF% to "%CR%%LF%" // Enable next command only when using a pre-prepared test set **************************************************** Variable Restore: Restore All Variables Text Box Display: Variables reported in 'GPX track - Display captured variables' // Get all variables into a text file as a list ********************************* // GPX filename =tTrackname.gpx Variable Modify String %tAllVariables%: Append Text (GPX file name) Variable Modify String %tAllVariables%: Append Text String Variable (%TAB%) Variable Modify String %tAllVariables%: Append Text String Variable (%tTrackname%) Variable Modify String %tAllVariables%: Append Text (.gpx) Variable Modify String %tAllVariables%: Append Text String Variable (%CRLF%) // tReportDate Variable Modify String %tAllVariables%: Append Text (ReportDate) Variable Modify String %tAllVariables%: Append Text String Variable (%TAB%) Variable Modify String %tAllVariables%: Append Text String Variable (%tReportDate%) Variable Modify String %tAllVariables%: Append Text String Variable (%CRLF%) // Track Descr'n = tTrackDescr Variable Modify String %tAllVariables%: Append Text (Track Descr'n) Variable Modify String %tAllVariables%: Append Text String Variable (%TAB%) Variable Modify String %tAllVariables%: Append Text String Variable (%tTrackDescr%) Variable Modify String %tAllVariables%: Append Text String Variable (%CRLF%) . . . // Profile Link GE (DEM) = tProfileLinkGE(DEM) Variable Modify String %tAllVariables%: Append Text (Profile Link GE(DEM)) Variable Modify String %tAllVariables%: Append Text String Variable (%TAB%) Variable Modify String %tAllVariables%: Append Text String Variable (%tProfileLinkGE(DEM)%) Variable Modify String %tAllVariables%: Append Text String Variable (%CRLF%) // Now save that list as a text file ************************************ Variable Modify String: Save %tAllVariables% to "C:\Users\terry\Dropbox\Excel+VBA (Sundry)\TEMP-VariableList.txt" // The reason for postponing the remaining entries for MM and Best Estimates (and any others) is to minimuse risk of havng to start afresh in the event of some problem or crash during those final stages. // Now switch to Excel and paste the entries from the list ********************************************** Macro Run: Open TrackData-New.xlsm Macro Run: VBA - ImportFile_1 The VBA macro proved easier than I'd thought. Tedious (50 copy/pastes, mainly to non-contiguous cells) but worthwhile as running it took 5 secs, compared with about 60 for the previous MX macro.