E
Ed
I have written an Excel VBA Add-in function that is used in
myWorkbook.xls. The function
opens Word and uses a data in one of the myWorkbook.xls worksheets as
the database for filling in a Mail Merge fields in the Word document.
A complication is
Excel won't let me do this directly from the myWorkbook.xls worksheet.
The workaround was to copy the needed worksheet to a new temporary
workbook tempJCNAFormsWks.xls
and use it as the Mail Merge data source:
Sheets(strWksName).Select
Sheets(strWksName).Copy
ChDir strMembershipDir
ActiveWorkbook.SaveAs fileName:=strMembershipDir &
"\tempJCNAFormsWks.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
(invoke Word... )
After the invocation of Word finishes, I close and Kill
tempJCNAFormsWks.xls:
On Error GoTo 0
Set wdApp = Nothing
ActiveWorkbook.Close
Kill strMembershipDir & "\tempJCNAFormsWks.xls"
That works great. The only problem is after saving myWorkbook.xls and
closing Excel I can still see
Excel.exe in the Wondows Task Manager.
Why is it doing this?
TIA
Ed
myWorkbook.xls. The function
opens Word and uses a data in one of the myWorkbook.xls worksheets as
the database for filling in a Mail Merge fields in the Word document.
A complication is
Excel won't let me do this directly from the myWorkbook.xls worksheet.
The workaround was to copy the needed worksheet to a new temporary
workbook tempJCNAFormsWks.xls
and use it as the Mail Merge data source:
Sheets(strWksName).Select
Sheets(strWksName).Copy
ChDir strMembershipDir
ActiveWorkbook.SaveAs fileName:=strMembershipDir &
"\tempJCNAFormsWks.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
(invoke Word... )
After the invocation of Word finishes, I close and Kill
tempJCNAFormsWks.xls:
On Error GoTo 0
Set wdApp = Nothing
ActiveWorkbook.Close
Kill strMembershipDir & "\tempJCNAFormsWks.xls"
That works great. The only problem is after saving myWorkbook.xls and
closing Excel I can still see
Excel.exe in the Wondows Task Manager.
Why is it doing this?
TIA
Ed