"Run" & "OnTime" - “Unable to run the specified macro.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15619
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

"Run" & "OnTime" - “Unable to run the specified macro.

Post by ChrisGreaves »

I am experiencing problems with the statements “Application.Run” and “Application.OnTime” and would appreciate, in the first instance, someone experienced in these two statements to try out my supplied code to see if they can duplicate the problem (on any platform)
I am Win7HP/Word2003.

I have a feeling that in my dotage I have made some simple, stupid, senile stumble.

Basically I issue an Application.Run from Player to Timer,
Timer then issues an Application.OnTime to Player,
ten seconds later Player is woken up, BUT ...
... when Player tries to repeat the Application.Run to Timer, the error “Unable to run the specified macro”.appears

The document “Player.doc” in the attached zip file “20200206_0801.zip” contains more detail.

Thanks
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
HansV
Administrator
Posts: 78483
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by HansV »

I get the same error, but why do you want to use two different documents for this?

BTW, in PlayerMacro, you should open the text file for Output, not for Input, since you want to write a line to it.
Best wishes,
Hans

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Run OnTime tripping over themselves, as they do...

Post by Doc.AElstein »

Hello Chris
I wish we had some of your nice snow. Instead, starting Sunday, we are in for a bad storm. So it will be off again to retrieve what ever gets blown into the neighbors gardens..

_._____

I assume both word documents should be open
I have to change the Input to Output in this line,

Code: Select all

Open ThisDocument.Path & "\" & strcFileName For Output As #intFile
or else the Sub PlayerMacro() does not work
( Possibly that is what Hans was saying )

The first time I run Sub PlayerMacro(), I get the same as you and Hans, that is to say it runs the first time , and 10 seconds later fails on its second attempt to run the macro with the message “Unable to run the specified macro”. ( Actually it says something in German, but I think it translates to about the same )


If I then start again , it fails on the first run with the message “Unable to run the specified macro”.


I restarted Word

I ran Sub PlayerMacro() a few times. The results were always the same. Sub PlayerMacro() ran , started Sub TimerMacro(), and that was it. Sub PlayerMacro() was not attempted a second time. No error. Nothing happened.

Then after a few attempts at running Sub PlayerMacro() , suddenly it errored every time at attempting to run Sub TimerMacro()

Sometimes when I restart word , and run Sub PlayerMacro(), it errors at the first attempt to run Sub TimerMacro()


So I get very inconsistent results.

I have not had much experience with these things in Word, but I have seen these sort of strange things in Excel before. Things like Application Run , Application OnTime and opening and closing text files don’t get on very well together

VBA seems to trip over itself as things are not quite finished when they should be and it gets in a real muddle

To get over these thing you need to experiment with various combinations of DoEvents, Activating , Selecting. Sometimes the thing sorts itself out if the macros are longer, that is to say if the macros are doing other things. *** But it might be a different issue all together***

I had a quick play and got your macros to be doing something like you want without erroring like this.

Code: Select all

Option Explicit
Public Const strcFileName As String = "Timer.txt"
Sub PlayerMacro()
Dim intFile As Integer
 Let intFile = FreeFile
 Open ThisDocument.Path & "\" & strcFileName For Output As #intFile
 Write #intFile, "projPlayer.modPlayer.PlayerMacro", 10 ''' "PlayerMacro",10
 Close intFile
 Documents("Timer.doc").Activate
 'Application.Run Macroname:="'" & ThisDocument.Path & "\" & "Timer" & "'" & "!modTimer.TimerMacro"
 Application.Run "projTimer.modTimer.TimerMacro"
 MsgBox prompt:="PlayerMacro"
End Sub

Code: Select all

Option Explicit
Public Const strcFileName As String = "Timer.txt"
Sub TimerMacro()
Dim intFile As Integer
 Let intFile = FreeFile
 Open ThisDocument.Path & "\" & strcFileName For Input As #intFile
Dim strMacroName As String
Dim lngDelay As Long
 Input #intFile, strMacroName, lngDelay
 Close intFile
 Documents("Player.doc").Activate
 Application.OnTime when:=Now() + TimeSerial(0, 0, lngDelay), Name:=strMacroName
 MsgBox prompt:="Timer Macro"
End Sub



What I get if I start that modified Sub PlayerMacro(), is that two message boxes come up one after the other.
10 seconds later the two message boxes come up one after the other.
10 seconds later the two message boxes come up one after the other
10 seconds later the two message boxes come up one after the other
10 seconds later the two message boxes come up one after the other
10 seconds later the two message boxes come up one after the other
10 seconds later the two message boxes come up one after the other
10 seconds later the two message boxes come up one after the other

10 seconds later the two message boxes come up one after the other
10 seconds later the two message boxes come up one after the other
10 seconds later the two message boxes come up one after the other
10 seconds later the two message boxes come up one after the other
10 seconds later the two message boxes come up one after the other
10 seconds later the two message boxes come up one after the other
10 seconds later the two message boxes come up one after the other


And so on… until I pull the mains plug out of the wall ……

( I get the same results in WORD 2003 and WORD 2007 )
***The problem might be a different issue to what I see in Excel. I am not too sure as I don't have much experience in Word. I notice that when I open two document in word, they tend to by default be in two different windows that i can move about independently. If open 2 files in Excel then they are sort of in the same window, on top of each other as it were. Maybe for that reason you need to do theActivating. I don't really understand the subtleties of what windows are what..
I also notice that Application Run seems to work a bit differently in Word than in Excel.
I expected this line alternative to open the document , Timer.doc

Code: Select all

Application.Run MacroName:="'" & ThisDocument.Path & "\" & "Timer" & "'" & "!modTimer.TimerMacro"
It don’t. Timer.doc has to be open for that code line alternative to work. In Excel, if you use that alternative syntax, then the Excel file with the macro in it would be opened. ( In Excel such a code line would then work whether the Excel File is initially open or not )
Maybe the crux of the problem is that the document you want to run something from or schedule to be run from, needs to be active. I am not sure


Alan



ref
https://www.excelforum.com/excel-progra ... ost5268177" onclick="window.open(this.href);return false;
Last edited by Doc.AElstein on 23 Feb 2020, 13:11, edited 2 times in total.
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15619
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by ChrisGreaves »

HansV wrote:I get the same error, but why do you want to use two different documents for this?

BTW, in PlayerMacro, you should open the text file for Output, not for Input, since you want to write a line to it.
Thanks Hans. Confirmation appreciated. Am working in better scheme. More on Monday.
Cheers
Chris
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15619
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by ChrisGreaves »

But please see my following post ...

HansV wrote:I get the same error, but why do you want to use two different documents for this? BTW, in PlayerMacro, you should open the text file for Output, not for Input, since you want to write a line to it.
I get the same error,
Hans, thanks for this confirmation; at least I know I am not yet a Senile etc etc.
…but why do you want to use two different documents for this?
I don’t, actually. I want to use dozens, ten at least.
“Timer” is a stripped down operating system which polices tasks to be run at different times.
“Player is just one such slave task. I have others :grin: such as “Saver”, “Clock”, “Record” and so on. Including Word documents to launch Excel workbooks, DOS batch files, System32 commands and so on.
“Clock” wants to be woken up as regular as clockwork on every five (or ten, or …) minute interval so that it can announce the time.
“Saver” will save all open documents every one, two, three or four minutes. (A facsimile of my MRUse application_
“Player”, (“BigPlayer” when it is all dressed up), grabs the Duration of an MP3 file from the metadata, issues the file to WinAmp, and then requests Timer that it (Player) be woken up after lngDuration seconds, at which event Player grabs a different track, duration, plays it and goes to sleep again. Player’s sleep times are based on a file’s duration, and appear as random lengths to Timer.
“Record” will wake up and record the temperature (or survey what you are doing right now or …)
Unlike MSWord (with one OnTime event) or Excel (ten events), Timer can accommodate as many scheduled tasks as you like and remembers them across reboots of Word or Windows and can be implemented as a simple module in any existing Word (or Excel or PPT or Outlook or …) application.
BTW, in PlayerMacro, you should open the text file for Output, not for Input, since you want to write a file to it.
Thanks. I am senile after all! I have changed it to Open Output,

(later) Mystery Solved, sort of.
I have previously noticed that (Word2003) Application.OnTime works to completion only if the target document is active. For example, my big baby, the proper player, wakes up and does WinAmp, but only if that player document is Active. If I Alt-Tab to my memoirs and start documenting my day, Memoirs.doc is active and Player.doc is not active, and the OnTime code does not find the Player macro, shrugs its shoulders, and slips off to the pub, without telling anybody.
The Application.Run appears to exhibit the same behaviour.

I set a breakpoint on each of the “intFile = FreeFile” statements (one in Timer, one in Player) and then re-ran the Player macro from VBE, first making sure that the Timer document was active.
When I arrived at the breakpoint in Timer, I made the Player.doc active before F5-ing Timer.
Ten seconds later I was at the breakpoint in Player; made Timer.doc active and F5, worked like a charm, as long as I remembered to make each target document active with an Alt-Tab. (so much for automation).

I had previously circumvented this activation problem with BigPlayer by dropping BigPlayer.doc into the startup folder.
Dropping Timer and Player into the startup folder did not resolve today’s local problem. I must manually switch between active documents for the scheme to work, even if the two documents are in the startup folder.

My help files suggest Application.Run "'My Document.doc'!ThisModule.ThisProcedure". I cannot understand the weird syntax; the single quotes obviate the ned for a change of delimiter from period to exclamation.
The help files also say “If you specify the document name, your code can only run macros in documents related to the current context— not just any macro in any document.”, which might be MS’s way of saying “This won’t work if the target document is not active”.
If so that suggests to me that back in pre-1997 the programmer assumed that the target macro would always be in the ActiveDocument. That there would be only one OnTime event, and that the target macros had better be in the OnTime project.
Which leaves the puzzle of why we would bother to specify the document name (in any form)
I tried four variations on Application.Run "'T:\Greaves\Startup\Word\Timer.doc'!modTimer.TimerMacro"
(1) & (2) With and without the document path
(3) & (4) Using the recommended exclamation mark and the wistful period.
All four combinations failed.
This is something to sleep on.
If I load the FullName document name into the text file I can automate the Document.Activate process to let the macro run, but that will cause me to type some of my memoirs into whichever application is woken up at that time.

(later still) “Application.Run MacroName:="Normal.Module2.Macro1" suggests that it might work in Normal. I move modTimer to my Normal.dot and close my Timer.dot and change the description in my Application.run.

(still later still) I have embarked on a trek, starting with all four micros in one module in Normal.dot, and gradually weaning them further and further away to see how far I can go while maintaining an OpSys with three slave applications that wake up on time.

Sulks
Chris
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15619
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by ChrisGreaves »

The 506KB zip file at www.ChrisGreaves.com/Downloads/20200210_0811.zip with its embedded 25-page PDF and Normal templates may be of interest to those who
(a) In Word2003 I have experienced problems with Application.Run and Application.OnTime
(b) are contemplating the use of Application.Run and Application.OnTime
(c) are having problems with VBA and incur a terrible feeling of being alone.

The document is incomplete and I will post a longer version when I am exhausted.
In the meantime I will be happy to update the document with corrections to any significant statement.

If you can make work what I cannot, I’ll have another shot at making it work.
If you cannot make it work where I can, I’ll acknowledge that too.

Thanks
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15619
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Run OnTime tripping over themselves, as they do...

Post by ChrisGreaves »

Doc.AElstein wrote:I wish we had some of your nice snow.
Hello Alan. Thank you for your content-rich replay, all except the bit I have reproduced above. :laugh: :rofl:

I have d/l your comments and will work my way through them. My early feelings were related to "Active" documents, but the deeper I dig the more strange workings i encounter.
I will work to complete my initial foray (Startup path vs. Templates path), and then take a break and work through your findings.

Please don't sweat the 25-page PDF. I have lodged it here for the record rather than to drop more work on peoples shoulders.

Cheers
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

"Run" & "OnTime" - Microsoft screwed up in Word

Post by Doc.AElstein »

Thanks for the snow, I would much rather shovel pretty cold snow than what I am spending half of today doing - tidying up/ repairing/ tying back down all what a major storm just now is ripping apart…
_.___

Have not gone through all your stuff yet, just some initial comments

So it looks like the strange need for having the document active is the main problem , and you are clearly a lot more clued up on that then me.
Your comments about ..“If you specify the document name, your code can only run macros in documents related to the current context— not just any macro in any document.”, being MS’s way of saying “This won’t work if the target document is not active” … That sounds like it is explaining what we have seen. .
*****Microsoft messed up and are trying to hide it with a bit of bullshit *****

I have not really done much in Word, but the initial results suggest to me that things like Run & On Time are working differently to as they do in Excel

_.___
ChrisGreaves wrote:. I cannot understand the weird syntax; the single quotes
Regarding the “Weird syntax alternative
I am fairly familiar with the “weird syntax” like … "'My Document. '!ThisModule.ThisProcedure"…. In Excel I use the equivalent of it a lot.
In fact I usually take it a bit further…. ( In Excel )
"'C:\My Folder\My Workbook.xlsm'!ThisModule.ThisProcedure"

Application.Run Macro:="'" & ThisWorkbook.Path & "\" & "IsClosed.xlsm" & "'" & "!Module1.myMacro", arg1:="xyz"


As I understand it , those two ' ' are quite often used in VBA in path strings to make sure all within them is taken as a single text. In this case they are optional. In some cases they are not optional
You will get away without them if you have no spaces in your path string and you will only need them if your path has spaces in any text, like “My Document".
I believe one reason that VBA has this ' ' convention is so that it does not mistake a space for something like an argument separator
_._____________
ChrisGreaves wrote:I tried four variations... All four combinations failed.
This sort of strange syntax alternative does work in your macros. I tried. ( I have a working syntax ‘commented out in my 1st post

Possible reason why your 4 attempts went wrong is...
_ The Microsoft documentation is slightly wrong. Here , for example, https://docs.microsoft.com/en-us/office ... cation.run" onclick="window.open(this.href);return false; , you see this:
Application.Run "Normal.Module1.MAIN"
Application.Run "MyProject.MyModule.MyProcedure"
Application.Run "'My Document.doc'!ThisModule.ThisProcedure"


That is not quite right. The last line is in error, It should be
Application.Run "'My Document'!ThisModule.ThisProcedure"

_ This works "'My Document'!ThisModule.ThisProcedure"…. It's based on the normal default stuff that you see in the VB Editor.
For example, I just created a new document. I named it My Document.doc
I have that document in the same Folder as your two documents.
Look at these screen shots and you will see how Microsoft have screwed up

In Word:- https://imgur.com/aH1hEHq" onclick="window.open(this.href);return false;
WordVBEditor.JPG

In Excel:- https://imgur.com/dMZFdu3" onclick="window.open(this.href);return false;
ExcelVBEditor.JPG
I may be wrong, but I suggest a possibility is that someone did not mean originally to miss off the .doc.. somewhere in their wiring it got missed out by mistake
_._____________

I am not too sure what the ! does. Conventionally it seems to separate a reference to something into two main parts. I can’t say any better than that yet.
_._____________


To add to the confusion, there is a bug in Application Run in Word, which Microsoft had an update for, which I expect messed it all up even more, so they removed it and removed all the documentation about it! ( KB190235 https://tinyurl.com/wzh2eah" onclick="window.open(this.href);return false; )
The end result is that occasionally if you include the document name it sometimes chucks up an error. Mostly it occurs when you use arguments. It seems that people have rarely been able to pass arguments unless they miss out the reference to the document and or Project.
This I guess explains to some extent the need to have the documents active - , in the case of passing arguments you might otherwise go to the wrong place with no document or project qualifier.

***** At the end of the day it all suggests that Microsoft made a mess with Application. Run in Word, and they have not done ( and I expect never will do ) anything about it. It could be that in the original wiring someone meant to have it working like Excel, but forgot somewhere to include the .doc and that has thrown the “spanner in the works”.
This shows up in
_ the opening of a document via the use of full path syntax not working, as it does work in Excel
and
_ the strange need we have been seeing of having to have the document active when code lines of Application.Run or Application OnTime are used.


_.__________________

To help demo some of what I have been talking about in this post...

I have uploaded my apply named document of mine , My Document.doc

It has this coding in it in the module named ThisModule

Code: Select all

Sub ThisProcedure()
 MsgBox prompt:="Hi"
End Sub
Sub ThisProcedure2(ByRef Msg As String)
 MsgBox prompt:=Msg
End Sub

If you place this following macro below in any other open document , ( which is saved in the same place as My Document.doc ) and run it , then it should go through running those two sub routines. It demos the different syntax possibilities. In the case of using arguments, you don’t have many possibilities, .. because I expect Microsoft screwed up somewhere.....

Code: Select all

 Sub CheckerWeirdSyntax()
 Documents("My Document.doc").Activate
 Application.Run Macroname:="Project.ThisModule.ThisProcedure"
 Application.Run Macroname:="'My Document'!ThisModule.ThisProcedure"
 Application.Run Macroname:="'" & ThisDocument.Path & "\" & "My Document" & "'" & "!ThisModule.ThisProcedure"   '
 
'  Application.Run Macroname:="Project.ThisModule.ThisProcedure2", varg1:="It is a bit Windy here!" '  ' This wont work as it should - Microsoft screwed up
 Application.Run Macroname:="ThisModule.ThisProcedure2", varg1:="It is a bit Windy here!"
'  Application.Run Macroname:="'" & ThisDocument.Path & "\" & "My Document" & "'" & "!ThisModule.ThisProcedure2", varg1:="It is a bit Windy here!"  ' This wont work as it should - Microsoft screwed up
End Sub

I will possibly take a look at your pdf later tomorrow , when the wind dies down a bit..


Alan
You do not have the required permissions to view the files attached to this post.
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by Doc.AElstein »

Hi Chris,
I took a quick look at your pdf over morning coffee.
I am not a Word man so it is a bit out of my depth and knowledge area, but I expect a Word bloke should find it worth a detailed read. ( maybe a note about it in the Word Sub forum might be worthwhile ).

You make some comments towards the end about that Microsoft Office was designed badly and that separate teams were established things like Word, Excel, and
_ they never quite got their act together.
I think what we are seeing also suggests that
_ the Word team maybe were not quite so good as the Excel team and made a few mistakes.

These two things maybe can explain some of the issues we have been seeing.

Alan

_.______________________________________________________

P.S. 1 …. In Excel a fix that gets me out of a lot of jams caused by Bugs is to use Application.OnTime with the scheduled time of Now() , in place of a Call or an Application.Run, and also it often helps in many situations where pop up windows and forms don’t appear as and when they should: dividing a code into sections with each section being fired from an Application.OnTime with the scheduled time of Now() often seems to solve annoying errors and bugs. It seems to help stop VBA tripping over itself as it sometimes seems to do.
It did not seem to help particularly when playing with your macros. I think this is because we are seeing that the issue was not VBA tripping over itself. The issue seems to be the need to activate what is having a macro in it run or being scheduled to be run
But it did no harm either when I tried a Application.OnTime with the scheduled time of Now() , in place of the Application.Run in your coding.
Just for completeness, this would be the version to replace your Application.Run with an Application.OnTime.

' In module modPlayer in document Player.doc

Code: Select all

' In module  modPlayer  in  document  Player.doc
Sub PlayerMacro2()
Dim intFile As Integer
 Let intFile = FreeFile
 Open ThisDocument.Path & "\" & strcFileName For Output As #intFile
 Write #intFile, "projPlayer.modPlayer.PlayerMacro2", 10 ''' "PlayerMacro",10
 Close intFile
 Documents("Timer.doc").Activate
 'Application.Run MacroName:="'" & ThisDocument.Path & "\" & "Timer" & "'" & "!modTimer.TimerMacro2" ' Full "Wierd syntax" for Application.Run
 'Application.Run "projTimer.modTimer.TimerMacro2"
 Application.OnTime when:=Now(), Name:="projTimer.modTimer.TimerMacro2"
 MsgBox prompt:="PlayerMacro2"
End Sub
' In module modTimer in document Timer.doc

Code: Select all

 ' In module  modTimer  in document  Timer.doc
Option Explicit
Public Const strcFileName As String = "Timer.txt"
Sub TimerMacro2()
Dim intFile As Integer
 Let intFile = FreeFile
 Open ThisDocument.Path & "\" & strcFileName For Input As #intFile
Dim strMacroName As String
Dim lngDelay As Long
 Input #intFile, strMacroName, lngDelay
 Close intFile
 Documents("Player.doc").Activate
 Application.OnTime when:=Now() + TimeSerial(0, 0, lngDelay), Name:=strMacroName ' for strMacroName = "projPlayer.modPlayer.PlayerMacro2"
 MsgBox prompt:="Timer Macro2"
End Sub
_._____________

Something interesting I noticed whilst playing with those above 2 code versions: In Word, Application.OnTime does not appear at first glance to accept the weird syntax
In Excel it does. And in Excel we do not see in Application.OnTime any of the needs for us to activate any Workbook: Indeed, we actually see the same characteristics as in Application.Run in Excel for Application.OnTime , that being that if we use the full “weird syntax “, then we can schedule a macro in a closed workbook, and when it is time to run, the workbook will be opened , provided the full “weird syntax “ contains the full path to where the workbook is… Passing arguments is also no problem – There was a lot of confusion for some time about the actual syntax required for this, but luckily recently a seemingly very smart chap has put the record straight on that one ( https://stackoverflow.com/questions/314 ... 2#59812342" onclick="window.open(this.href);return false; )

So once again we see what appears to be some inconsistency with Word and Excel for a method which one might have reasonably expected should work similarly in both…
( If I am not mistaken , it appears that I cannot pass arguments in Word Application.OnTime … - Possibly because as the Word design team made a mess of passing arguments with Application.Run , they decided to not even bother to attempt to get argument passing working in Application.OnTime )
_._____________________________________________

P.s. 2 I seem to be able to copy text and even parts of images from your pdf. I have noticed in the past that I can copy text from certain pdf files. This is the firs time that I ever noticed that I can copy bits of images.. maybe I just never noticed before. I don’t use pdf much
CopyBitsOfChrissImages.JPG : https://imgur.com/vJZn2RS" onclick="window.open(this.href);return false;


_.______________________________________________

P.S. 3 I also have noticed that if when running your TimerMacro PlayerMacro pair , I open another document, then Player macro, shrugs its shoulders, and slips off to the pub, without telling anybody …. That is a handy alternative to pulling the mains plug out to stop them running !!
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15619
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: "Run" & "OnTime" - Microsoft screwed up in Word

Post by ChrisGreaves »

Doc.AElstein wrote:Have not gone through all your stuff yet, just some initial comments
Alan thanks for these.

Here (attached) is my latest package, cleaned up quite a bit. It consists of a Normal.DOT for Word2003. Comes with a timer system and 3 slave procedures. Should run as-is, but see the paragraph “Quick Test of Timer007.ZIP” and the following paragraphs, but you can’t run the DateLastPlayed because you don’t have the mammoth Access MDB.
Nonetheless, you’ll be doing me a great favour if you:-
(a) Implement the Timer007.zip system on your MSWord platform (and confirm that it ran, I Hope, I Hope)
(b) Migrate the Timer007.zip system to Excel, making notes of what needs to change to accommodate the different syntax for OnTime in Excel
(c) Let me/us know what needs to be changed. I will try to incorporate your findings into my next version of WhatFAQEnhanced.

Now Timer007.dot is just my latest stable system.
I am now probing the depths of iniquity which arise when I migrate the application templates to a Startup Addin that is separate from Normal.dot and an OnTime processor that is likewise divorced from Normal.dot and is a Startup Addin.

Today I am struggling with the concept of restartability and dealing with multiple instances of scheduled events in the communications file.


Cheers
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

"Jog" & "OnTime - I am getting slow, and don't have any snow

Post by Doc.AElstein »

Hi Chris,
Sorry I am a bit slow … I think my brain must be slowing down like the speed of my jogging is. .. I think I am getting slow at getting the point….

I don’t have a clue what you are asking me to do with this…
….. Implement the Timer007.zip system on your MSWord platform (and confirm that it ran…….
I am afraid an idiot like me needs a slightly more detailed set of instructions on what I should be doing/trying.

And I don’t understand this
….but see the paragraph “Quick Test of Timer007.ZIP”……
_...Where is that paragraph?
I can’t see any notes and / or explanations of anything
This is what your last package looks like:
FromChris14Feb.JPG : https://imgur.com/LvZcyvw" onclick="window.open(this.href);return false;
FromChris14Feb.JPG
Timer007.DOT opens as an empty document
Clock.dot has this in it ……….. First home-away-from-home for modClock of Normal.dot
Player.dot has this in it ……… First home-away-from-home for modPlayer of Normal.dot
Saver.dot has this in it …………. This application saves all open documents every thirty seconds
( all files have macros in them , I think )


I may have missed the obvious: remember I don’t have too much experience with WORD. Maybe it would be obvious if I had read all your last pdf in more detail, but I have only had a quick look at it so far.

_.____

I will be happy to try out anything for you, if you can give idiot proof instructions on what I should do be doing.

I will also be happy to try and convert stuff to work in Excel , … once you've helped me figure out what you want me to do in WORD..

Alan
You do not have the required permissions to view the files attached to this post.
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15619
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: "Jog" & "OnTime - I am getting slow, and don't have any

Post by ChrisGreaves »

Doc.AElstein wrote:… I think my brain must be slowing down
DEA> Sorry I am a bit slow … I think my brain must be slowing down like the speed of my jogging is. .. I think I am getting slow at getting the point….
Alan, it is not you, it is me. There are secret parts of my life that disorient my responses and work, like The Fountains Of Home that arrived in my laundry room yesterday and made Lake Laverie – an inch or two of water that ultimately found its way to the heating air-duct in the floor behind the washing machine. Disrupts my Saturdays something awful, these frozen and then ruptured copper pipes.

DEA> I don’t have a clue what you are asking me to do with this… ….. Implement the Timer007.zip system on your MSWord platform (and confirm that it ran……. I am afraid an idiot like me needs a slightly more detailed set of instructions on what I should be doing/trying.
Again, mea culpa. I usually issue a Setup package that puts everything in the right place, but this being a little non-standard issue I failed to use Setup, and failed then to issue manual instructions, so let me now run through the process and document it in the section below Steps to take to “prove” Timer007.dot.

DEA> And I don’t understand this ….but see the paragraph “Quick Test of Timer007.ZIP”…… _...Where is that paragraph? I can’t see any notes and / or explanations of anything
Again, my fault, in haste. The short paragraph is in the WhatFAQEnhanced guide which has exploded to 50 pages.

DEA> Timer007.DOT opens as an empty document
Correct. Most of my applications have no body test; I document them in a stand-alone document. I have caused you unnecessary worry in this.

DEA> I will also be happy to try and convert stuff to work in Excel , … once I have figured out what you want me to do in WORD.

Thanks. At the end of the attached document I suggested that too. If you want to go ahead an work Excel into this, please give me a heads-up, and then I will essay in parallel with you.
Cheers
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by Doc.AElstein »

Hi Chris,
The problem is maybe that you are missing a deep Cellar. We usually managed to have temperatures mostly just above zero in the Cellar even when we had -17 C outside, ( and we have no heating in the cellar). Pipes mostly didn't freeze there in the cellar. When they did freeze occaisionally, it was just a by a few degrees under zero in a few isolated places, which doesn't usually cause the pipes to burst when they thaw out..
But we have had some badly frozen and then burst pipes in winter in the main house, so I know the feeling. The weather can introduce a lot of extra work sometimes.

_.____________________
So I had an initial go…..

The screen shot in my last post , ( http://www.eileenslounge.com/viewtopic. ... 74#p264221" onclick="window.open(this.href);return false; ) , shows the contents of the (“normal” , as I call it folder) with the name “14thFeb
It is made from the “zip folder”, named “Timer007.zip” from this post: http://www.eileenslounge.com/viewtopic. ... 03#p264219" onclick="window.open(this.href);return false;

_._____________

My lack of computer education means I never really understood what zip and extracting them is all about.
But what I always do with a “zipped thing” is this:

Before I download it I make a normal folder. In this case the one named “14thFeb
I then download the “zip thing anywhere” .
( In this case I have them both in the main folder where I have anything to do with Eileen’s Lounge and Word stuff.
The zipped and unzipped Timmer007.JPG : https://imgur.com/yszVRS0" onclick="window.open(this.href);return false; )

I then navigate to where the zip thing is , double click on it to reveal the contents , then select and copy the entire contents , then navigate into the normal folder, and paste all the contents into the “normal folder”

I think in Vista, Windows 7 and Windows 10 that somehow automatically turns the contents into normal files in a normal Folder. After that I ignore the zip thing and do everything with the stuff in the normal Folder.

I think that means that I am as far as your steps (1) – (3) in “Alan.doc”. What you refer to as your Startup folder is my folder named “14thFeb”.

Step (4) in “Alan.doc”: - I think this means I should have all 4 documents open. Possibly I should open them all at the same time. I have never tried that before. But I just did. I held the Ctrl key as I selected them from the open dialogue. Then selected open. It seems to work, :)
Open 4 at Once.JPG : https://imgur.com/9egIXBU" onclick="window.open(this.href);return false;

Nothing happens. I wouldn’t expect it to. I have my security setting to disable macros and ask me if I want to enable them.

So I closed the files, changed my security settings to enable all macros , SecurityEnableAllMacros.JPG : https://imgur.com/0inPTeS" onclick="window.open(this.href);return false; , and re opened all at the same time again.

This time I have a compile error:
Compile Error Speech.JPG : https://imgur.com/JW3ZxoF" onclick="window.open(this.href);return false;

I am not sure what the problem is. I do not appear to have any broken references
No Broken References.JPG : https://imgur.com/YBLUAmx" onclick="window.open(this.href);return false;

But I do notice what appears to be some new things
New Things.JPG : https://imgur.com/SXagk9r" onclick="window.open(this.href);return false;


Nothing happens as far as I can tell. The immediate window stays empty.
_.________________________
That all above was the story in WORD 2007. That was on my main computer. I have used this a lot with Excel and Excel VBA and Word. I have not done much Word VBA, but most of the Word VBA that I have done has been on that computer.
( Untill recently my Office 2007 was still getting updates. ( Don't believe anything Microsoft says about what they support and what they don't support, and what does or doesn't get updates. What they do and what they say are two different things regarding support and updates. ) )
(This main machine also has Office 2003. But I occaisionally had some awkward interactions with the two versions of Word, so I deinstalled and reinstalled Office 2003 without Word )
_._________________________________________

I tried in WORD 2003 ( on a different computer ) . I changed the security setting to enable all macros and opened all 4 word documents simultaneously.
This time things seem better….. Things are going on in the Immediate window…
Things going on in Word2003.JPG : https://imgur.com/uGjavXc" onclick="window.open(this.href);return false;

( This computer had a along period not connected to the internet, and for a couple of years has had intermitent internet connections. This computer is unique and often does things thought to be theoretically imposible, such as sometimes accessing internet sites when no other computer in the world appears to be able to )
_.______________________-

I tried in WORD 2010 ( on another different computer ). I changed the security setting to enable all macros and opened all 4 word documents simultaneously. This computer has avarage properties, is often on the internet in different locations, and still gets Office 2010 updates.

Again success
Success in 2010.JPG : https://imgur.com/ds049Nz" onclick="window.open(this.href);return false;

_.__________________-

In all versions I see those new things in the references. But there is no check against them.
References 2003.JPG : https://imgur.com/o2dXRst" onclick="window.open(this.href);return false;
References 2010.JPG : https://imgur.com/ZoYRyJ3" onclick="window.open(this.href);return false;
( 2007 : https://imgur.com/SXagk9r" onclick="window.open(this.href);return false; )

_.¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬_________________________

Those are the results so far. I will leave the two working computers doing their thing for a while…

I will look further over the next few days. I have a few other computers with 2003 , 2007 and 2010. I will check on those.



Alan
Last edited by Doc.AElstein on 17 Feb 2020, 20:27, edited 4 times in total.
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by Doc.AElstein »

Hi Chris,
Here an update for Monday 17thFeb, ( around Monday morning breakfast time, approx 9.00am German time….
So I left two computers scheduling over night. One with Word 2010 and the other with Word 2003

Word 2010 still appears to be happily scheduling itself:
Word 2010 still schceduling.JPG : https://imgur.com/FId2AYS" onclick="window.open(this.href);return false;
I am not too sure about Word 2003. The immediate window appeared to have stopped. But when I clicked on it, new scheduling appeared, and since then it still appears to be going along happily. As you see from the next screenshot, there appears to be a gap in the times. But I don’t know what happened in between. I am not sure if it was
_doing anything overnight ,
or if
_ I woke it up this morning
2003 possibly still going Not sure.JPG : https://imgur.com/cPwxHMD" onclick="window.open(this.href);return false;

_.__________________________________-

This morning I have tried on a couple of other computers. These both have been in average use over the last 7-8 years , apart from a long period in the middle of that time of about 18 months , when they were not in use at all.

One has Office 2003 , the other Office 2007.
I did not have the computers from new, but I know that they had a registered Office version from new and were used normally, but not much with Word.
I have started using Word a bit on them in the last couple of years and have had no problems. I have never done any Word VBA on them until this morning, when I tried your stuff…

So....


A computer with Word 2003:
I changed the security settings, MinimumMacroSecurityWord2003.JPG , https://imgur.com/GN1vbl1" onclick="window.open(this.href);return false; , restarted the computer and opened simultaneously all your files.
Result:-
I get the Compile error as I did on my main computer as reported in the last post:
Compile Error 2003.JPG : https://imgur.com/Qdnwgba" onclick="window.open(this.href);return false;
Nothing happens in the immediate window:
Immediate Window remains empty 2003.JPG : https://imgur.com/fT6MjR9" onclick="window.open(this.href);return false;
_.___

A Other computer with Word 2007:
Same story
I changed the security settings, MinimumMacroSecurityWord2007.JPG : https://imgur.com/JEq71bi" onclick="window.open(this.href);return false; , restarted the computer and opened simultaneously all your files.
Result:-
I get the Compile error again
Compile Error 2007.JPG : https://imgur.com/olUoD7A" onclick="window.open(this.href);return false;
And again nothing happens in the immediate window:
Immediate Window remains empty 2007.JPG : https://imgur.com/nnlmt58" onclick="window.open(this.href);return false;


_._____________

I will leave the two schedule working computers scheduling while I go and repair the damage from last nights storm ...… give me the cold calm pretty white stuff any day
( It is about 10.45 am. German time now, and those two computers from the previous post which worked since last night are still happily scheduling – the Word 2010 was going all night, and the Word 2003 may or may not have been going all night. Maybe I woke the Word 2003 up this morning. I am not sure )
_._____
I guess that means that I am almost as far step (8), but not quite, as I only get so far on a couple of computers.

Alan

_._______________

Attached is that typical compile error , that I am getting so far on three computers. 2 with Word 2007, one with Word 2003. (By the way, the English translation for that compile error, you probably geussed, is along the lines of
…. Compile failed
Project or library not found …….
)

So there seems to be an issue sometimes with the code line of
Public speech As SpVoice
You do not have the required permissions to view the files attached to this post.
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15619
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by ChrisGreaves »

Doc.AElstein wrote:Attached is that typical compile error , that I am getting so far on three computers. 2 with Word 2007, one with Word 2003.
Alan, I apologise for my tardy response. I am falling behind in my mail.
Untitled.png
This is what I see in Tools, Refernces in the VBA editor.
I hope that this helps.
Cheers
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by Doc.AElstein »

You don’t have to apologise Chris.
I am the same. My Email builds up over the Summer months when I read some and store the others to be worked on in Winter. I have not done anything like as much as I wanted this Winter, and my provider is sending me warnings now saying I have too much stored.
I had about 10 major problems to look at this Winter. The first 2 ….
_1) VPN - got that well sussed.
_ 2) xxxx - I doubt I will finish that this winter.. :(

Still , things are looking up. I got up to go to the lav day before yesterday in the middle of the night and there was snow everywhere. :snow: :smile: So I spent an hour shovelling it quick before it melted. – I know, I know, what’s the point if it melts anyway … if I shovel it into heaps along the side of the path it stays a bit longer and looks pretty https://eileenslounge.com/viewtopic.php ... 39#p264111" onclick="window.open(this.href);return false;

Maybe we will get a bit of Winter now, so I will stay inside a few weeks longer.. but I doubt it..

_.________________________________________________________

So… _
_A general update

I .. did not have much to do on those two computer where I left your stuff going. So I left your stuff going… :) …. – Both are still happily scheduling
( Note: on one of them I had changed the user a few times, and used both Excel and Word on the other user. When I went back to the user where your macros are busy scheduling – it is still happily scheduling. So it lived through me doing other office stuff on the computer without any bad interactions… )

_.B . The reference issue
I took a peak at the references in the two computers which are happily working … they all have the
Microsoft Speech Object Library Checked.
ReferrenceOnWorkingWord.JPG : https://imgur.com/vu3Xw3a" onclick="window.open(this.href);return false;


Typically, on computers where I got the error, that is not checked:
ReferrencesKB2007Word.JPG : https://imgur.com/Fo4mpxD" onclick="window.open(this.href);return false;

_._______________

Things started getting very messy after this point…

Clearly there is some issue with the Microsoft Speech Object Library , and it is a reasonable guess that it needs to be checked
I do not know if Word Library referencing works similarly as in Excel….
I assume you know that in Word , you normally have the first 4 references.. At least that is how it is in Excel. I assume it is the same in Word.
The others you check as needed .. That is generally called Early Binding I think, and generally not a good idea in sharing stuff, and in your case potentially deadly , as I found out….

On the two out of 20 machines of mine in which your stuff works, I am guessing that for some reason, way in the past , which I have now forgotten, I may have checked that reference. I am not sure. Maybe there is some other reason that they have not had an issue.

All the other computers were most likely close to a virgin state as far as Word VBA is concerned. I cannot be 100% sure on that. But I don’t think any ever had that Microsoft Speech Object Library reference checked..


I looked a bit further at one machine which was not working.

In two files, we have a broken reference:
Timer007RefOnKB.JPG , ClockRefKB.JPG
https://imgur.com/Mc688hi" onclick="window.open(this.href);return false; , https://imgur.com/FqxlN9e" onclick="window.open(this.href);return false;


( I don’t know at this stage what that Timer check is about in your last screenshot, I don’t know if it has any relevance to what we are doing?. )

_.__

If I look in my “Normal” VB project, then the reference to Microsoft Speech Object Library is there, and I was able to check it. InNormalSpeechIsThereAndCanCheckIt.JPG , https://imgur.com/87GkTkO" onclick="window.open(this.href);return false;
I did check it . … Bad mistake
After this all hell broke loose… I had frequent strange crashes and error messages which I have never seen before, both on opening Word or on restarting my computer ..

I tried various combinations of restarting Word / and or restarting my computer and attempting to somehow get to have the option to check that Microsoft Speech Object Library on your files.
It gets very messy. For one thing, it appears that you must remove or disable Private Sub Document_Open() in Timer007.doc . Then you have to , ..
remove the broken reference ,
save the file,
restart Word and or your computer ,
.. at which point the reference usually becomes available, and strangely is already towards the top – you don’t have to scroll to find it in many cases.. but it is not checked.
But you can check it
https://imgur.com/WopsqUb" onclick="window.open(this.href);return false; , https://imgur.com/WUtI70O" onclick="window.open(this.href);return false; ,

_.____

In your WhatFAQEnhances.pdf you mention towards the start something about “Delete (and hence rebuild) Normal.dot” I am not sure how that fits in with your instructions in Alan.doc?


_.________________

In the course of experimenting , things like this came up at attempts to open, or after a crash.
ErrorAfterCrash.JPG : https://imgur.com/onkyTMJ" onclick="window.open(this.href);return false; : ErrorAfterCrash2.JPG : https://imgur.com/n0BNiYm" onclick="window.open(this.href);return false;
ErrorAfterCrash.JPG
ErrorAfterCrash2.JPG

They translate to things like….
Fatal error in Word with Microsoft office live add-in Add-In. If this error message has been displayed several times, you should deactivate this add-in and check whether an update is available. Do you want to disable this add-in?
….
Access violation at address 0048D9EF in module 'WSHelper.exe'. Read of address 00000008



As time has gone on , I keep getting strange errors and crashes in this particular computer since then.

The only way so far that I can consistently get the rescheduling to keep rescheduling on this particular computer is to only open Timer.doc.
Occasionally it keeps going with one or more of the other files open. But usually opening one or more of the other documents stops the thing scheduling itself.

I took a long breath at this point…
_._____

_.___________
You do not have the required permissions to view the files attached to this post.
Last edited by Doc.AElstein on 29 Feb 2020, 14:54, edited 2 times in total.
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by Doc.AElstein »

_.___________

After a long breath


I started again on another computer on which your stuff had not been working. The first thing I did was to open Timer007.doc , and take out Private Sub Document_Open().
Then I take out the check to the broken reference.
Then I restart Word, and check that reference to Microsoft Speech Object Library ,
then put back in Private Sub Document_Open() and save and close the file.
Then for the other 3 files, one at a time, I open it, take out the broken reference, save and close it, restart Word, check the reference to Microsoft Speech Object Library , and save and close the file.

After this I opened the 4 files together and in the Immediate Window the rescheduling is going on.


So I have now three computers scheduling.
My main computer, in front of me is not yet that far, This computer is the one that crashed a lot. I have a feeling I may need to re install Word and start again , doing then as I did with the last ( third computer that I have working,) .
( Or I may leave this main computer as it is for now .
I have lots of computers and Office versions , and I occasionally find interesting things go on when I use one that has something broken or corrupted . )



I still have not quite figured out exactly what you are trying to do with all this, that is probably due to me as usual taking a while to get the point. But I do have a gut feel that what ever it is it should be doing, it is not doing it particularly well, and I don’t think it would be wise to let this thing loose on the innocent public.
I don’t think anyone should try it unless they don’t mind the possibility of it killing their Word
. I expect you probably know enough about the project , that it might be safe for you to do things. I have maybe not quite got far enough at knowing all what should be happening yet.

For me, personally, a much clearer, introduction is needed in your WhatFAQEnhances.pdf. But that might be just me. Others may get the point quicker. I might even get the point if I read all of WhatFAQEnhances.pdf often enough
In WhatFAQEnhances.pdf you start at an earlier point showing the coding, before I can get a grasp of the overall picture.
Your notes remind me a bit of the notes I make for myself, which are very thorough and very useful for my later reference, but which are missing a bit sometimes for others to follow.

I am not sure I would recommend many others to attempt to do anything with your files, just yet…

I will take a guess that you always had the reference to the Microsoft Speech Object Library checked in all your development. So you may never have experienced what your stuff can do should a reference to it be missing on any document, as I have.

_._______________

Some Conclusions:
These conclusions may not be too accurate, it is just an un educated guess from me at this stage..

I think if you attempt to open your 4 files in Word , without the Microsoft Speech Object Library checked, as I did, then sometimes something goes on, possibly triggered by Private Sub Document_Open() in Timer007.doc .
This may really chuck a spanner in the works and causes an unhealthy chain of events that may corrupt and/ or break things which prevents what you want to do ever working on a computer.. I think that reason alone would make it unwise ever to unleash it on the public… not in its current form anyway..
Possibly it may be wise if you intend passing this stuff around to have a prominent warning somewhere like
Do not attempt to open files without the Microsoft Speech Object Library reference checked

So I guess I am still at around step 8) of your notes that you done for me , Alan.doc.
I may have got that far now on some more computers, but it has not been easy and will probably mean I need to re install Office on one computer. That is not a problem for me at all, although I may need to defer doing that for a while, …

The issue with not knowing about the need to check that reference has caused a lot of grief.. but nothing serious :) , I haven’t got the Coronavirus yet!
The issue may be something totally different. I don’t know.

Alan


( P.S. On second reading , I should say that I have not yet made any attempt to do the optional Step 5) from the notes in Alan.doc. I was not too clear about what that was about , so I left it out to avoid other complications at this stage.. )
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by Doc.AElstein »

… Sunday morning ( in March already, apparantly ) , over a coffee, or 5……..
Two things:-
_._________________
_ 1 )
Doc.AElstein wrote:.....The only way so far that I can consistently get the rescheduling to keep rescheduling on this particular computer is to only open Timer.doc.
Occasionally it keeps going with one or more of the other files open. But usually opening one or more of the other documents stops the thing scheduling itself. ....
I found out by chance what is going on here… we are back to the original issue of this Thread…
Timer007.DOT must be active.
You can activate a different file temporarily in between when Timer is scheduling itself, but if it is not active when it is planned to re schedule itself then the rescheduling stops…

_._______

_ 2 ) Because of my lack of word experience, I overlooked that your 4 files are .dot files, not .doc as I had been thinking / stupidly assuming. ( My eyes don’t notice at first glance the difference in the two)
( A quick Google tells me that .dot are template files. That’s as much as I feel like learning about them just now.)

_2a) I mostly need to fiddle and change and save things to get your stuff to work ( see previous posts about the Microsoft Speech Object Library issue )
In my ignorance I was probably saving the files , which can lead to various copies being made from the template. This has likely contributed to a muddle to explain some of the confusion and results that I was getting.

_2c) I think I have learnt from this that when changing and saving anything I need to use the Save icon in the VB Editor only, and steer clear of saving in any other way.

( I may not have a corrupted Word, as I had thought, on my main computer, after all. I may just need to remove some files. How disappointing. )
_.____

Possibly these two revelations will help me get a bit further sometime. ( I am off now to organise a new garage for my Father in Law.. for a day or 2 or 3 … or whatever/ how ever long it takes… :) )

‘Till then.
Alan
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Bointing Bointing ….. Bointing Bointing ….. Bointing Bointin

Post by Doc.AElstein »

This is just a small update , Chris, on a minor event that took place middle last week. I thought I would mention it in passing, - It may not be too important, although it gave me quite a shock at the time….

So the state of affairs was that I had a couple of old computers happily scheduling themselves ……you know the drill….
..Timer scheduling itself for ……
Timer scheduling itself for ……
Timer scheduling itself for ……
…….. etc

(This was pending me getting around to move on past your Step 8) some time in the future... ……)

One of the computers is an old cobbled together thing of uncertain origin, Windows 7 64Bit Pro Operating System, and I had your stuff up and running in Word from Office 2010. Coincidentally , as I later found out, that computer is still connected to an amplifier and loud speaker hidden behind the sofa which I had long since forgotten about... …

Middle of last week , about quarter past 2 in the afternoon, I almost died from shock when a loud voice started shouting at me from behind the Sofa. I could not quite make out what it was saying, since I was dead exited and scared by it, - I was thinking that maybe God, or a recently deceased neighbour, who we all hated , might be talking to me.
It was something approximately like..
Bointing Bointing …..
..
Bointing Bointing …..
..
Bointing Bointing
…..

I finally realised that something different was going on with your stuff on one of the two computers. … It would appear that a Clock was scheduling itself intermittently. I would guess that it did it as many times as I heard the chant…. Bointing Bointing. But I cant be sure as I was still shivering from fear at the time.
An error message came up , and when I pressed the Debug button it sometimes showed the error line highlighted, ( as one would normally expect) , and then something it tried to run something again, and then the same error came up again. Eventually it settled down.
Here are a few screenshots taken during this settling down period..
https://imgur.com/jh45voZ" onclick="window.open(this.href);return false; , https://imgur.com/s6M8xOp" onclick="window.open(this.href);return false; , https://imgur.com/G0I3qTH" onclick="window.open(this.href);return false; , https://imgur.com/b3S5hGq" onclick="window.open(this.href);return false; , https://imgur.com/vYr13ki" onclick="window.open(this.href);return false;
I think it tried approximately almost a half a dozen times to do something , after I hit the Debug button, always then erroring at the same place.

That error translates in English to approximately …
Runtime error ‘-2147352573 (80020003)’:
The specified macro cannot be executed


So I just thought I would share that arousing experience with you. It was a very entertaining and exhilarating experience. Freighting at the time, as some of the best life experiences often are.. :)

That old computers has 2 users on it. The User doing your stuff was one I made just for some VPN experiments last month. I don’t need it, so I will leave it in this final state and ignore it for now. Maybe it has some other surprises in store for me.
At the time of this occurrence, that computer was doing nothing at all apart from your stuff. I also had several computers up and running , some connected to the same mains rail as that computer, and they showed no unusual unexpected activity at this time. Just now I have started using the second User account on that computer, and it is working normally



I will post again if I move on past step 8) with either the remaining computer or maybe with another one from scratch..

Alan

_._______________

Here below is the current state of that computer User screen. As shown in that screen shot, the last normal “Timer scheduling itself for…” was at 14:15:10 on Wednesday 4th March, 2020. After that there was a mixture of Clock and Timer scheduling itself, predominantly Clock
06_FinalState.JPG : https://imgur.com/xNAnxOR" onclick="window.open(this.href);return false;
06_FinalState.JPG
You do not have the required permissions to view the files attached to this post.
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: "Run" & "OnTime" - “Unable to run the specified macro.

Post by Doc.AElstein »

Hi Chris.
I am tidying up a few loose ends before the end of my Winter Computer time….

I just started reading WhatFAQEnhances.pdf again. ( That is the .pdf file in the zip download from here : http://www.eileenslounge.com/viewtopic. ... 24#p264010" onclick="window.open(this.href);return false; )
Its got your real address in it. So I/ we will all be coming to seek refuge soon to hide from the Corona virus.
The rest is still a bit too much for me to follow. I get the basic idea, almost.. perhaps .. but I am just too thick to see the wood for the trees I think.
BTW the paragraph “Quick Test of Timer007.ZIP” is not in anything you have uploaded , you may have suggested that it is in a new version of WhatFAQEnhanced guide. I am not sure. But that is probably no longer important or relavant...

_.________________________________-
So .. where was I , a couple of Sundays ago…. 1st March http://www.eileenslounge.com/viewtopic. ... 24#p264955" onclick="window.open(this.href);return false;

I had got to step 8) of your notes for me. ( Alan.doc ) . - But it was not easy, and my previous replies explain the problems and solutions to get that far…

_.____

I still have one computer that since a month has been happily Time scheduling itself every second.
Unlike most attempts, that has been successful from the start because
_ a) For some reason it did not need the tweaking of the Microsoft Speech Object Library, which most often appears to be needed.
_ b) By chance, after opening all 4 files, ( Player.dot , Saver.dot , Clock.dot , Timer007.DOT ) , the Timer007.DOT was active. This is a requirement for that scheduling to go on.

What is actually going on, would appear to be Sub OnTimerProcess() calling the macro that is in the variable , strcTimerMacroName . I can’t figure out much more than that as to what is going on.
_._____
I will try to move on anyway...…
From Alan.doc :-
Step (9) Set the constant lngcIntervalMinutes to the value 1. After the next step, this should cause the clock to speak the time every one minute.
Huh?? – would have been useful to have a hint of where that constant might be. – I did a search of all macros in all files for lngcIntervalMinutes
No luck. I could not find it.

So stuck at Step (9)



Alan
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also