+ Reply to Thread
Results 1 to 4 of 4

how to bypass password??

  1. #1
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500

    how to bypass password??

    Hi

    I have a workbook which when I open the document it comes up saying "Password" workbook is reserved by somebody" please enter in password"

    is there a way to create a macro which would enter in the password then press enter to open the workbook? I will be running this macro from a separate workbook and I know the password.

  2. #2
    Mike Fogleman
    Guest

    Re: how to bypass password??

    This may give you an idea for your problem. I use it to open a password
    protected workbook from another open workbook, where both are in the same
    folder. It then runs a macro that resides in the protected workbook within a
    general code module.

    Sub RunTracking()
    Dim cdir As String
    Dim wb As Workbook

    For Each wb In Workbooks
    If wb.name = "NCP Tracking.xls" Then
    MsgBox ("NCP Tracking.xls is already open.")
    Exit Sub
    End If
    Next wb
    cdir = ActiveWorkbook.Path
    Workbooks.Open cdir & "\NCP Tracking.xls", password:="NCP"
    Application.Run ("'NCP Tracking.xls'!RunUpdate")
    End Sub

    Good Luck,
    Mike F

    "funkymonkUK" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Hi
    >
    > I have a workbook which when I open the document it comes up saying
    > "Password" workbook is reserved by somebody" please enter in password"
    >
    > is there a way to create a macro which would enter in the password then
    > press enter to open the workbook? I will be running this macro from a
    > separate workbook and I know the password.
    >
    >
    > --
    > funkymonkUK
    > ------------------------------------------------------------------------
    > funkymonkUK's Profile:
    > http://www.excelforum.com/member.php...o&userid=18135
    > View this thread: http://www.excelforum.com/showthread...hreadid=552161
    >




  3. #3
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500

    Help with sendkeys to bypass password

    hi i tried the password property but no help.

    I managed to get it to work if i used the following

    Sub Macro1()

    'cancel password which is Stewart

    'Dim extractor As String
    'extractor = ThisWorkbook.Name

    'make file read-only
    Application.SendKeys ("%r") '("stewart~")
    Workbooks.Open Filename:= _
    "C:\Documents and Settings\ME\Desktop\Test.xls"
    Sheets("home").Select

    ' ActiveWindow.Close

    End Sub

    when I run the sendkeys function it works however it places the word stewart which is the password in my code any where that I have the cursor. Is there a way I could stop this?

  4. #4
    Mike Fogleman
    Guest

    Re: how to bypass password??

    You got me. There must be more to this than meets the eye, because the code:

    Workbooks.Open "WorkBookPath", password:="MyPassword"

    is standard code for opening a workbook with password.
    Sendkeys is normally used on a different application that does not use VBA.
    Maybe someone else has an idea to offer.

    Mike F

    "funkymonkUK" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > hi i tried the password property but no help.
    >
    > I managed to get it to work if i used the following
    >
    > Sub Macro1()
    >
    > 'cancel password which is Stewart
    >
    > 'Dim extractor As String
    > 'extractor = ThisWorkbook.Name
    >
    > 'make file read-only
    > Application.SendKeys ("%r") '("stewart~")
    > Workbooks.Open Filename:= _
    > "C:\Documents and Settings\ME\Desktop\Test.xls"
    > Sheets("home").Select
    >
    > ' ActiveWindow.Close
    >
    > End Sub
    >
    > when I run the sendkeys function it works however it places the word
    > stewart which is the password in my code any where that I have the
    > cursor. Is there a way I could stop this?
    >
    >
    > --
    > funkymonkUK
    > ------------------------------------------------------------------------
    > funkymonkUK's Profile:
    > http://www.excelforum.com/member.php...o&userid=18135
    > View this thread: http://www.excelforum.com/showthread...hreadid=552161
    >




+ 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