Results 1 to 3 of 3

Open, copy and save to password protected workbook

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Open, copy and save to password protected workbook

    Hi all,

    Having issues with my code. I am working between two network workbooks. One is for data entry, the other is for data collection. For some reason, I am the only one who has been able to get this working and I am not sure why. I have my 1st workbook (EEG Tech form) which is populated and submitted to a 2nd workbook (EEG Billng Log) The EEG billing log has a writerespassword set up (neuro). Here is my code I am using.

    Sub Logsheet()
    SendKeys "N"
    Workbooks.Open Filename:="\\vumcnk-iom1\D\EEG Billing Project\Beta Billing Log\EEG Billing Log.xlsm", _
    password:="", writerespassword:="neuro"
    
    On Error GoTo Errorcatch
    
        Dim sourceRange As Range
        Dim destrange As Range
        Dim Lr As Long
        Lr = lastrow(Workbooks("EEG Billing Log.xlsm").Sheets("Sheet1")) + 1
            Set sourceRange = Workbooks("EEG Tech Form.xlsm").Worksheets("Pull sheet").Range("A2:S2")
            With sourceRange
            Set destrange = Workbooks("EEG Billing Log.xlsm").Worksheets("Sheet1").Range("A" & Lr). _
            Resize(.Rows.Count, .Columns.Count)
            
        End With
        destrange.Value = sourceRange.Value
          
        Application.DisplayAlerts = False
        ActiveWorkbook.Save
        
        ActiveWorkbook.SaveAs Filename:="\\vumcnk-iom1\D\EEG Billing Project\Beta Billing Log\EEG Billing Log.xlsm", _
        password:="", writerespassword:="neuro", CreateBackup:=False
        ActiveWorkbook.Close
        Application.DisplayAlerts = True
       Exit Sub
    
    Errorcatch:
    MsgBox Err.Description
    
    
        
        End Sub
    For some reason, the above is only working for me. Any other user, my terminal or their's, can go through the motions of filling out the form and processing it. It seems to run through all the routines, but the information, even though visible on the opened sheet (EEG Billing log), does not save.

    I am wondering if I might not be getting the password submitted correctly. I have really run out of ideas and could use some expert advice as to why this isn't working as I would like.


    Let me know if you need a sample project.


    Many thanks,
    Patrick
    Last edited by pjbassdc; 08-27-2013 at 11:41 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA to open a password protected workbook
    By Larry.LeBlanc@O in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-07-2016, 11:02 AM
  2. [SOLVED] Password array to open all password protected workbook in a folder
    By rename in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-07-2012, 05:06 AM
  3. [SOLVED] Open workbook that is password protected for modifying + VBA + VBS
    By uimhirADo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-26-2012, 02:15 AM
  4. vba macro open password protected workbook
    By Ray in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2006, 11:15 AM
  5. Replies: 4
    Last Post: 08-25-2005, 07:05 PM

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