Relative instead of Absolute paths in Excel VBA

Post date: Jan 16, 2014 10:16:13 AM

Application.ScreenUpdating = False

' import file -----------------------------------------------------------------

ChDir ThisWorkbook.Path

fname = Application.GetOpenFilename

If fname = False Then

MsgBox "User pressed cancel"

Sheets("home").Select

Exit Sub

Else

Workbooks.Open Filename:=fname

WA = ActiveWindow.Caption

' Application.ScreenUpdating = False

'------------------/ delete row to the sales report

Windows(Worigin).Activate

Sheets("salesreport").Select

wrk = ActiveWorkbook.Name