View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Daniel CHEN
 
Posts: n/a
Default Macro target to MsWord

Not quite sure where did you get the following statement:
Application "C:\EMS-Senior1\Individual Report Class1.doc"
-- the purpose is to open the file, right?

Try to replace it with this one and re-run your code:

Shell "WinWord C:\EMS-Senior1\Individual Report Class1.doc"

It worked in my PC!

--
Best regards,
---
Yongjun CHEN
=================================
XLDataSoft - Data Analysis Expert, Excel/VBA Specialist
- - - - www.XLDataSoft.com - - - -
Free Excel-Based Data Processing Tool is Available for Download
=================================



"Param" wrote in message
...
Pls correct me on this formula: something wrong on opening file.

Sub openreport()
myPWD = Application.InputBox("Password Protected! Please Enter Authorized
Password to Continue!")
If myPWD = "ems5657sifooc1" Then
Application "C:\EMS-Senior1\Individual Report Class1.doc"
Else
MsgBox "Wrong Password! Bye!"
End If
For Each w In Workbooks
w.Save
Next
Application.quit
End Sub