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
Bookmarks