Forum Discussion

Lionel Dyck's avatar
Lionel Dyck
Copper Contributor
Apr 19, 2018

CHDIR or Workbooks.OpenText filename is failing in VBA

I have a VBA driven workbook and after the recent Office 365 update one of the routines started to fail. The routine gets the current path of the open workbook and then does a CHDIR to it.  It then opens a file in that path. Prior to the update to Version 1803 (build 9126.2152) the open would work WITHOUT having to provide the path in the filename. After the update the only way to get it working was to add the path to the filename.

 

The statements that are involved are:

 

ChDir ActiveWorkbook.Path

 

and

 

 Workbooks.OpenText filename:=Path & "\" & sheet & ".csv"

 

The part in bold was added to make it work.

 

I have reported this issue.

No RepliesBe the first to reply

Resources