Charles Bushby
New Member
- Joined
- Aug 10, 2005
- Messages
- 42
Below is an extract of some code that fails because there are spaces in the pathname and the filename (e.g. "AR timesheet.xlsm". I have tried various options such as Chr(34), """"" and %20 but can't seem to get it to work. If I take out the spaces in the path and filename then the code works fine but for various reasons I have to have spaces.
Dim FolderName As String, wbName As String
FolderName = "\\sw-dc2\Shared\Central Region\Time sheets"
wbName = Dir(FolderName & "" & "*.xlsm")
Dim FolderName As String, wbName As String
FolderName = "\\sw-dc2\Shared\Central Region\Time sheets"
wbName = Dir(FolderName & "" & "*.xlsm")