ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ChDir "F:\dump" - not working (https://www.excelbanter.com/excel-programming/444912-chdir-f-%5Cdump-not-working.html)

Madiya

ChDir "F:\dump" - not working
 
I am using xl2007.
Im my macro, I am trying to change link in all cells by pointing them
to the new file.
I have tried only file name with chdir and full file name with path
but none works.
ChDir "F:\dump" is not changing the dir at all. Excel still keep
pointing to my documents.

Its simple but I cant get it straight.
Pl help.

Regards,
Madiya

Vacuum Sealed

ChDir "F:\dump" - not working
 
Hi Madiya

Try this:

ChDrive "F:\"
ChDir "F:\Dump"
FileToOpen = Application.GetOpenFilename _
(Title:="Select a File", _
FileFilter:="Excel Files *.xls (*.xls),")

If FileToOpen = False Then
MsgBox "No File has been Selected.", vbExclamation, "Doh!!!"
Exit Sub
Else
Workbooks.Open Filename:=FileToOpen
End If

HTH
Mick



Madiya

ChDir "F:\dump" - not working
 
On Aug 31, 4:14*pm, "Vacuum Sealed" wrote:
HiMadiya

Try this:

* * ChDrive "F:\"
* * ChDir "F:\Dump"
* * FileToOpen = Application.GetOpenFilename _
* * (Title:="Select a File", _
* * FileFilter:="Excel Files *.xls (*.xls),")

* * If FileToOpen = False Then
* * MsgBox "No File has been Selected.", vbExclamation, "Doh!!!"
* * Exit Sub
* * Else
* * Workbooks.Open Filename:=FileToOpen
* * End If

HTH
Mick


It worked.
Thanks a ton.

Regards,
Madiya


All times are GMT +1. The time now is 10:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com