maclachlan19
Board Regular
- Joined
- Jul 8, 2013
- Messages
- 53
I'm having problems understanding how to designate a specific file path on this line of code.
This works as long as the file is one folder before \old reports..... As soon as the file is moved the code no longer works.
I would like to be able to hardcode a folder such as D:\DealerShare\Accounting\ELR Analysis.log, but this doesn't seem to work.
the full code is as follows in case this helps
This works as long as the file is one folder before \old reports..... As soon as the file is moved the code no longer works.
I would like to be able to hardcode a folder such as D:\DealerShare\Accounting\ELR Analysis.log, but this doesn't seem to work.
Code:
Open ThisWorkbook.Path & "\old reports\Log Files\ELR Analysis.log" For Append As [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL]
the full code is as follows in case this helps
Code:
Private Sub Workbook_Open()On Error GoTo errhandler:
Open ThisWorkbook.Path & "\old reports\Log Files\ELR Analysis.log" For Append As [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL]
Print [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL] , Application.UserName, Now
Close [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL]
Exit Sub
errhandler:
MsgBox "Log file not saved"
End Sub