+ Reply to Thread
Results 1 to 2 of 2

Macro target to MsWord

  1. #1
    Param
    Guest

    Macro target to MsWord

    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


  2. #2
    Daniel CHEN
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1