Jump to content
Macro Express Forums

All Activity

This stream auto-updates     

  1. Last week
  2. Maybe try closing all macro files and create a macro file without macros. Just a random idea. Edit: Try remove and reinstall.
  3. Thanks everyone, Cory. 1. Frequency is 2 secs, but behaviour doesn't alter with any frequency. 2. Synchronising is on but deactivating it makes no difference. 3. Backing up when the Editor closes. 4. ME runs at startup.The account logged in is an administrator, but I am not specifically running ME as administrator. terrypin There is no macro running, it is logged every time the scheduler checks (every 2 seconds if that is the setting) I will report to Insight.
  4. Maybe some sort of time zone issue? If you could post a minimal scheduled macro that causes that behaviour we could try to reproduce. FWIW I regularly use scheduled macros for important reminders. I've never changed the frequency from its default of 10 s, but I don't see that notification. P.S: It's Valentine's day tomorrow!
  5. Report to ISS first. Just a few thoughts off the top of my head What's the frequency? Are you synchronizing? (Preferences > File System> Network tab > Synchronize the macro file Are you backing up? Are you running MEP with elevated permissions? (AKA Run as Administrator)
  6. I would report the issue to Insight Software. It might be a bug.
  7. I have just upgraded from ME3 to Pro 6.1.3.1 Preferences are set to Log Unusual Events. Every time the scheduler checks for Scheduled Macros (whatever frequency is set) I get the following event logged 13 February 2020 09:15:48:206: Datafile.GetActMacros error: Invalid argument to time encode fname: F:\xxxxx\xxxxx\xxxxxxx.mex I doesn't seem to affect macro execution as far as I can tell, but it makes for a large log file, and means I have to have notifications of unusual events turned off. Anyone come across this? Thanks, Pete
  8. Interesting, thanks Pete, I'll explore that alternative more thoroughly to see if I can get a simple example working. But from initial study it looks a fair bit more complex than my usual method of launching a VBA macro from an MEP macro, namely with Alt+F8 as discussed up-thread. However it opens up a possible new approach to transferring data between Excel and MEP that I'd never been aware of before. I've been using either - the clipboard - or reading an intermediate (and otherwise redundant) text file. So many thanks for the heads up!
  9. Earlier
  10. I know this topic is 6 months old but I thought I'd add something.... The following registry key can be accessed from and written to by VBA code. HKEY_CURRENT_USER\Software\VB and VBA Program Settings\ I have many ME macros which open an Excel Workbook and run a specific Excel macro utilising this registry key to pass data. To run a specific Excel Macro when a workbook is opened:- 1. Add the following code to the Excel Workbook Private Sub Workbook_Open() Dim sMacroName As String 'Run the Macro in Registry RunExcelMacro, Clear Registry value sMacroName = GetSetting("MyProject", "RunExcelMacro") SaveSetting "MyProject", "RunExcelMacro", "" If sMacroName <> "" Then Application.Run sMacroName End If End Sub 2. Write a registry string containing the name of the Excel Macro, E.G. HKEY_CURRENT_USER\Software\VB and VBA Program Settings\MyProject\RunExcelMacro 3. Launch your Excel workbook and the Excel Macro will run. Hope this helps someone, Pete
  11. That's very kind of you, Cory, thank you, but I'm going to pass. My list of 'things to learn' is not getting any smaller. So I try to resist most new temptations. Right now I'm doing my best to move beyond my 'google/copy/paste/edit' mode of writing Excel VBA macros. Never having learnt any object based programming language, that's struggle enough for now. And I also need to get back to some practical electronics in the shed workshop to continue my Arduino programming. 😉
  12. Pleased to hear it Brian. Still waiting to hear from Naresh - from nearly three years ago!
  13. I don't if this helped him two years ago, but it helped me just now! Thank you!
  14. I appreciate you just want to move on but here are a few thoughts. Either your settings are incorrect or there are security measures preventing transmission. Malware often is used to make your machine a zombie and send spam so it's a common thing that security software will try to block. And some servers are ficicy about being used this way. I tried my Office 365 server and couldn't get it to work with that script. However I do use the .NET SMTPClient class. One reasons i suggested SendPulse is that it's not finicky and often works when I can't get anything else to work. If you want, I'll email you my credentials and you can try it. It is free BTW. SendPulse is not an email service. It offers a few different services for mass mailing mostly, but use of their SMTP servers is one of the services one can use for free if the volume is low. I would be happy to make you a command line program for you. It would only take a few minutes in VB.NET. Or Ican make it a Windows Form you can interact with using controls in MEP. But I think a console app would be cool. I can have it accept your information as command line parameters. Maybe if the message is large, we could point it to a file. Most of my programs use a email/SMS notification feature, so it's easy for me.
  15. Thanks Cory, appreciate your follow-up. But I couldn't get that working here. I tried both my BT Internet and Gmail settings (copied from my offline email program, Forte's Agent). Both gave the same error: https://www.dropbox.com/s/9el2xdxhknbcnhc/CoryVBS-Email-2.jpg?raw=1 I decided against following the detailed instructions here about fixing that error, as I don't want to risk it simply out of curiosity. https://support.microsoft.com/en-gb/help/928100/error-message-when-you-try-to-programmatically-send-an-e-mail-message And as I already have at least three email accounts I'll pass on trying SendPulse. It's not worth your spending much time on but here's a redacted version of what i tried: https://www.dropbox.com/s/it9h8dz165nkp9g/CoryVBScriptToSendEMail-Gmail-Redacted.vbs?raw=1
  16. This works for me. I used my SendPulse account. SendPulse is free for a limited number of emails. But it's a high number. I use it for many things. You might consider setting up a free account. In any case, just change the values on lines 5-8 for your SMTP server and your to, from, etcetera on lines 12-15. VBScript To Send EMail.vbs
  17. That sounds like your SMTP server settings. GIve me what you have with your password and sensitive stuff redacted and I'll see if it works with my settings.
  18. Thanks Cory. As mentioned, I'm only using VBS as a learning exercise. And now my curiosity is piqued. The script I tried only offered me that Outlook option. Ive tried a few other scripts in vain. That one you suggested looked promising but gave the error 'The transport failed to connect to the server.' Knowing very little about VBS and almost nothing about the obscure workings of email delivery, servers and such, I was hoping to get by in copy/paste/edit mode, with little further investment! I'll put it on the back burner for now. But MEP's command works OK. Terry, East Grinstead, UK
  19. Why don't you use the MEP email command? If using VBS, I wouldn't use MAPI. I'd use and SMTP.Client object. So I'm not much help in VBS because either I would do it in the MEP email command, or do it in VB.NET. But the SMTPCLient has the ability to send simple messages without having to create a message object. You might check it out. Just looking around in VBScript I see ones like this that look simple enough using CDO.Message. Sorry I can't help you with the profile prompt. I know that's really the answer you're looking for. However if it were me I'd not involve Outlook unless I had a real need to that I couldn't do with one of these classes.
  20. ... Write Myself a Letter. Well, an email. In retirement I no longer need an app such as MLO, like Alexis, but I do set alarms to remind me of important ToDos. Right now I'm trying to add a macro to send an email on a special scheduled date, as a backup to my regular one. I thought I'd also learn a bit more about the External Script command at the same time. The macro works fine except for the rather serious snag that the VBS script apparently insists on user input to close a dialog. It won't let me type Enter or click the mouse to close it. Not much use for an alarm I want to set days or weeks ahead! For this discussion I've shown the macro intended for immediate activation, rather than scheduled. To test just change the email address in the script. Or leave it as it is and you should get a Delivery Status Notification (Failure) email instead. The dialog that won't respond to MEP is shown below. Playing with Options and Properties brought no joy. It seems that VBS takes priority. I'm not clear why a dialog is displayed anyway as there's only one option, Outlook. (I don't use it, but my regular email app, Agent, doesn't support IMAP.) Anyone know enough about VBS to bypass that dialog please? // This macro inserts the text contents of the clipboard into the body of a message and emails it immediately (using Outlook) to my BT address. Delay: 0.1 seconds Variable Set String %tBody% from the clipboard contents Delay: 0.1 seconds External Script: VBScript Wait for Window Title: Choose Profile Text Type (Simulate Keystrokes): <ENTER> <COMMENT Value="This macro inserts the text contents of the clipboard into the body of a message and emails it immediately (using Outlook) to my BT address."/> <DELAY Flags="\x01" Time="0.1"/> <VARIABLE SET STRING Option="\x02" Destination="%tBody%" NoEmbeddedVars="FALSE"/> <DELAY Flags="\x01" Time="0.1"/> <EXTERNAL SCRIPT Language="VBScript" Dest="%tConsole%" Script="Dim ToAddress\r\nDim MessageSubject\r\nDim MessageBody\r\nDim MessageAttachment\r\n\r\nDim ol, ns, newMail\r\n\r\nToAddress = \"abc@xyz.com\" ' Change this to your own address to test\r\nMessageSubject = \"Test using VBS\"\r\nMessageBody = \"{%}tBody{%}\"\r\n\r\nSet ol = WScript.CreateObject(\"Outlook.Application\")\r\nSet ns = ol.getNamespace(\"MAPI\")\r\nns.logon \"\",\"\",true,false\r\nSet newMail = ol.CreateItem(olMailItem)\r\nnewMail.Subject = MessageSubject\r\nnewMail.Body = MessageBody & vbCrLf\r\n\r\n' validate the recipient, just in case...\r\nSet myRecipient = ns.CreateRecipient(ToAddress)\r\nmyRecipient.Resolve\r\nIf Not myRecipient.Resolved Then\r\nMsgBox \"unknown recipient\"\r\nElse\r\n newMail.Recipients.Add(myRecipient)\r\n newMail.Send\r\nEnd If\r\n\r\nSet ol = Nothing" Encoding="0"/> <WAIT FOR WINDOW TITLE Title="Choose Profile" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="10"/> <TEXT TYPE Action="0" Text="<ENTER>"/> And here's the VBS script: ========================= = Dim ToAddress Dim MessageSubject Dim MessageBody Dim MessageAttachment Dim ol, ns, newMail ToAddress = "abc@xyz.com" ' Change this to your own address to test MessageSubject = "Test using VBS" MessageBody = "{%}tBody{%}" Set ol = WScript.CreateObject("Outlook.Application") Set ns = ol.getNamespace("MAPI") ns.logon "","",true,false Set newMail = ol.CreateItem(olMailItem) newMail.Subject = MessageSubject newMail.Body = MessageBody & vbCrLf ' validate the recipient, just in case... Set myRecipient = ns.CreateRecipient(ToAddress) myRecipient.Resolve If Not myRecipient.Resolved Then MsgBox "unknown recipient" Else newMail.Recipients.Add(myRecipient) newMail.Send End If Set ol = Nothing
  21. Hello again, just wanted to say that the Issues are still present. What I also noticed is that every time the above happens, the MEX process starts to duplicate itself. I can't even kill the processes because I get an "Access Denied" error message, only a reboot helps. Is there a way to avoid it?
  22. @acantor @terrypin Alan and Terry, I've tested out both of these macros and they both work great! Many thanks for your hard work!
  23. You're welcome. Also there are some online RegEx debuggers for free like this one which I have not tried yet. I use a Windows program RegEx Buddy which I recommend. If you ever want to play with some.
  24. Thanks Cory, interesting idea. As per my reply to Alan, I’ve decided to tolerate the untidiness until the project is completely finished.
  25. Thanks Thanks Alan. I’ve always found that handy myself but I’ll see if unchecking makes the subject task any easier. When developing a complex macro like this one, it’s useful that when routinely saving it MEP pops up a series of warnings and tapping Y to each very quickly gets the undefined variables setup. BTW, I can’t test the following right now (posting from my iPad), but I think I’m right that I can confine my task to the main macro? IOW, even if all the many of the submacros it calls have their necessary variables defined (as well as unnecessary ones), the main macro must also have these defined too? Anyway, I’ve decided to postpone this ‘housekeeping’ until the entire project is finished!
  26. Not sure if this MEP setting simplifies the process, but I'll put it out there. Years ago, I unchecked this checkbox, and haven't missed the extra prompt every time I create a variable. MEP almost always correctly guesses the type of variable: I uncheck "Prompt the user to create a variable that is not defined."
  27. I don't understand exactly, but I think I'd export to text and grab all the variables using RegEx. Make a unique list for each macro. Them it should be obvious which are needed.
  1. Load more activity
×
×
  • Create New...