Macro target to MsWord

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
=================================
 

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

Similar Threads


Back
Top