UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
2 Pages V < 1 2  (Go to first unread post)
   Reply to this topicStart new topic
> Outlook Freezes With Macro, Any Version    
 
   
dflak
post Oct 9 2018, 01:37 PM
Post#21


Utter Access VIP
Posts: 6,226
Joined: 22-June 04
From: North Carolina


I'm back on the Outlook version.

I like your idea Jon. I'll plant a bunch of land mines and when I hear an explosion, I'll look to see where it is.

I've done this kind of thing before: set flags that get flipped when the code runs through them sort of like the semaphores used by railroads in the 1800's.

I thought you knew of some sort of logging program within Outlook sort of like Windows error logs.

If this were a "regular" error, I'd step through the code, but it's so intermittent I can't replicate it. It hasn't occurred since I re-activated it this morning, but I haven't sent or replied to a lot of emails today.

VB is VB, maybe I can make a VB script file that can be run by the task scheduler to do this. I used Excel because I am most familiar with it. Also I have "industrialized" the scheduling process. I have an Excel script template: you fill in the path name, the file name and the macro to run and it produces the string the task scheduler needs to open the script. The script has an on open event that runs the macro in the target workbook. So it's a "fill in the blanks" type of operation.

--------------------
Dan

One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
Please zip and attach samples. It makes life easier for those who have to figure out what you are trying to do. Thanks
Go to the top of the page
 
JonSmith
post Oct 10 2018, 02:45 AM
Post#22



Posts: 3,908
Joined: 19-October 10



If my gut is right then no matter what language you do to this automation in (VBA, VBScript, Powershell) then the error will occur as its due to a hidden dialog. All of those languages will still make a hidden dialog appear.

Let us know what landmines get triggered, if its random then its perhaps a 'save draft mail' message or something. Either way we should start making the picture clearer.
Go to the top of the page
 
dflak
post Oct 10 2018, 10:33 AM
Post#23


Utter Access VIP
Posts: 6,226
Joined: 22-June 04
From: North Carolina


There is a difference between the various methods. With the Outlook code, the timer is running in the background all the time. Other methods, outside Outlook, open a separate instance of Outlook, run it and then close. It is the closing of the Excel Script that is interfering with open Excel workbooks. That's why running a .vb file instead might work.

So far, my DoEvents seem to be holding the line but I haven't been composing or responding to a lot of mail today.

--------------------
Dan

One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
Please zip and attach samples. It makes life easier for those who have to figure out what you are trying to do. Thanks
Go to the top of the page
 
cheekybuddha
post Oct 10 2018, 11:28 AM
Post#24


UtterAccess VIP
Posts: 10,428
Joined: 6-December 03
From: Telegraph Hill


You won't be able to use API calls from a vbscript (but you could use other forms of creating a timer).

d

--------------------


Regards,

David Marten
Go to the top of the page
 
dflak
post Oct 10 2018, 04:17 PM
Post#25


Utter Access VIP
Posts: 6,226
Joined: 22-June 04
From: North Carolina


I don't need a timer in the code: I have the Windows Task Scheduler to do that for me.

I'm going to have to read up on vb scripts outside of Excel. Excel makes use of some libraries to talk to Outlook. This might not be do-able, but I haven't even started a search yet.

--------------------
Dan

One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
Please zip and attach samples. It makes life easier for those who have to figure out what you are trying to do. Thanks
Go to the top of the page
 
JonSmith
post Oct 11 2018, 02:38 AM
Post#26



Posts: 3,908
Joined: 19-October 10



So my gut says that the issues are occurring when Outlook runs in the same instance. I seem to recall that Outlook is one of those weird ones where even if you specify a new instance in code it'll be tied to the one already open as so my assumption is/was this would remain true whether you use VBA in Outlook or Excel or if you use VBScript or Powershell.

Happy to be proved wrong!
Go to the top of the page
 
dflak
post Oct 11 2018, 07:56 AM
Post#27


Utter Access VIP
Posts: 6,226
Joined: 22-June 04
From: North Carolina


You may be right. I may be crazy. smile.gif

I had to work with my IT department to get them to allow me to run a VB script and I have permission for only one folder. But it's enough. The script "compiles" but doesn't seem to be running properly. So I have debugging work to do.

But before I do that, I may again revisit my Excel version. There is one thing different about this workbook than the others I run from the task scheduler. This one I run only if logged in. The others run whether I am logged in or not and they run in the background. So I will switch it out and try that. I know from experience that even though I have Outlook on the machine and configured, it won't work if I am not logged in. I have to be logged in for any programs using Outlook to work, but since I will fire this event when I log in, that won't be an issue.

So I will have to delete the Outlook Code (again) and turn on the Task Scheduler and log out and log back in to try it.

--------------------
Dan

One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
Please zip and attach samples. It makes life easier for those who have to figure out what you are trying to do. Thanks
Go to the top of the page
 
2 Pages V < 1 2


Custom Search
RSSSearch   Top   Lo-Fi    16th October 2018 - 09:57 PM