Previously working Word Macro stopped working?

D

Dr Tom

I previously created a macro (borrowing heavily form examples) that
replaced the File Save in Word and automatically saved a file with teh
date and time in the format "yyddmm hhmm". THis was done to collect
drug information questions completed by our residents and to insure
that we could track them by date and time. Rather than rely on the
resident to enter the data they could just do a File Save and be done.
It has worked for approximately 3 years until today! THe maco, as
written, is:

Sub FileSave()
ChangeFileOpenDirectory "G:\COMMON\Pharmacy\DI_Ques\"
Dim MyDocTitle As String
MyDocTitle = Format(Date, "yymmdd") + Format(Time, " hhmm")

With Dialogs(wdDialogFileSummaryInfo)
.Title = MyDocTitle
.Execute
End With

Dialogs(wdDialogFileSave).Show
End Sub

However, now when I run it I get a message that tells me "The
requested member of the collection does not exist" and gives me a
"5941" error.

Unfortunately I am not practiced enough to know what to do. I tried
Googling the answer (which often works) but got nowhere, and I assume
it is because I am not very VBA savvy. What frustrates me is that it
worked swimmingly well for so long and then something changed and I
don't know what it was. Can any of the WORD/VBA gurus help?

Thank you
 
D

Dr Tom

I previously created a macro (borrowing heavily form examples) that
replaced the File Save in Word and automatically saved a file with teh
date and time in the format "yyddmm hhmm". THis was done to collect
drug information questions completed by our residents and to insure
that we could track them by date and time. Rather than rely on the
resident to enter the data they could just do a File Save and be done.
It has worked for approximately 3 years until today! THe maco, as
written, is:

Sub FileSave()
    ChangeFileOpenDirectory "G:\COMMON\Pharmacy\DI_Ques\"
    Dim MyDocTitle As String
    MyDocTitle = Format(Date, "yymmdd") + Format(Time, " hhmm")

    With Dialogs(wdDialogFileSummaryInfo)
        .Title = MyDocTitle
        .Execute
    End With

    Dialogs(wdDialogFileSave).Show
End Sub

However, now when I run it I get a message that tells me "The
requested member of the collection does not exist" and gives me a
"5941" error.

Unfortunately I am not practiced enough to know what to do. I tried
Googling the answer (which often works) but got nowhere, and I assume
it is because I am not very VBA savvy. What frustrates me is that it
worked swimmingly well for so long and then something changed and I
don't know what it was. Can any of the WORD/VBA gurus help?

Thank you

Apparently not only am I not much of a programmer, I am not much of a
typist. Where I said "borrowing heavily form examples" I meant
"borrowing heavily FROM examples". I didn't want to make it any more
confusing than it already is - sorry!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top