I basically want the variable wkbname to act as a directory e.g
Workbooks.Open Filename:="c:directoryDays Cover.xls"
this is what I have it doesn't work any help?
GetDirPath_ThisWorkbook (wkbname)
ChDir (wkbname)
Workbooks.Open Filename:=wkbname"Days Cover.xls"
Public wkbname
Function GetDirPath_ThisWorkbook(wkbname) As String
'Returns the path from a filespec
Dim x As Variant
x = Split(ThisWorkbook.FullName, Application.PathSeparator)
ReDim Preserve x(0 To UBound(x) - 1)
GetDir_ThisWorkbook = Join(x, Application.PathSeparator) & Application.PathSeparator
wkbname = GetDir_ThisWorkbook
End Function
Workbooks.Open Filename:="c:directoryDays Cover.xls"
this is what I have it doesn't work any help?
GetDirPath_ThisWorkbook (wkbname)
ChDir (wkbname)
Workbooks.Open Filename:=wkbname"Days Cover.xls"
Public wkbname
Function GetDirPath_ThisWorkbook(wkbname) As String
'Returns the path from a filespec
Dim x As Variant
x = Split(ThisWorkbook.FullName, Application.PathSeparator)
ReDim Preserve x(0 To UBound(x) - 1)
GetDir_ThisWorkbook = Join(x, Application.PathSeparator) & Application.PathSeparator
wkbname = GetDir_ThisWorkbook
End Function