ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to load these XLS files (https://www.excelbanter.com/excel-programming/304366-how-load-these-xls-files.html)

Jako[_31_]

How to load these XLS files
 
I am receiving workbooks from someone who is using the filename a
follows : <TodaysDate NW AB.XLS

For example today i received a workbook with this filname...

180704 NW AB.xls

and tomorrow i will receive a workbook named

190704 NW AB.xls

Also the received files are stored in C:\CASTLE\NORTH WEST\

Please could someone tell me how to programmatically write some code t
auto load the file received without having to browse for th
file.Obviously it has something to do with Format Date but am unsure f
exactly how to do this. Also before loading the file i want to copy th
received file into D:\RECEIVED\NORTH WEST\

Thanks in advance

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

How to load these XLS files
 

Workbooks.Open Filename:= "C:\CASTLE\NORTH WEST\" & _
Format(Date,"ddmmyy") & " NW AB.xls"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jako " wrote in message
...
I am receiving workbooks from someone who is using the filename as
follows : <TodaysDate NW AB.XLS

For example today i received a workbook with this filname...

180704 NW AB.xls

and tomorrow i will receive a workbook named

190704 NW AB.xls

Also the received files are stored in C:\CASTLE\NORTH WEST\

Please could someone tell me how to programmatically write some code to
auto load the file received without having to browse for the
file.Obviously it has something to do with Format Date but am unsure fo
exactly how to do this. Also before loading the file i want to copy the
received file into D:\RECEIVED\NORTH WEST\

Thanks in advance.


---
Message posted from http://www.ExcelForum.com/




Tom Ogilvy

How to load these XLS files
 
Dim s1 as String, s2 as Strnig, sName as String
s1 = "C:\CASTLE\NORTH WEST\"
s2 = "D:\RECEIVED\NORTH WEST\"
sName = format(Date,"ddmmyy") & " NW AB.xls"
filecopy s1 & sName, s2 & sName
workbooks.open s1 & sName

--
Regards,
Tom Ogilvy



"Jako " wrote in message
...
I am receiving workbooks from someone who is using the filename as
follows : <TodaysDate NW AB.XLS

For example today i received a workbook with this filname...

180704 NW AB.xls

and tomorrow i will receive a workbook named

190704 NW AB.xls

Also the received files are stored in C:\CASTLE\NORTH WEST\

Please could someone tell me how to programmatically write some code to
auto load the file received without having to browse for the
file.Obviously it has something to do with Format Date but am unsure fo
exactly how to do this. Also before loading the file i want to copy the
received file into D:\RECEIVED\NORTH WEST\

Thanks in advance.


---
Message posted from http://www.ExcelForum.com/




Jako[_32_]

How to load these XLS files
 
Many thanks that works a treat.

Could you please tell me how i delete the file from

"C:\CASTLE\NORTH WEST\"

after copying it.

Also i don't want to be prompted if i want to delete the file.

Cheer

--
Message posted from http://www.ExcelForum.com


Tim Coddington

How to load these XLS files
 
Name is actually a move, not a copy. I'm sure you could do the
name command, then open the sheet on the D: drive to use it. A
little modification of Tom's code should do the trick.

But, for future reference, the keyword to look up in help is KILL.

"Jako " wrote in message
...
Many thanks that works a treat.

Could you please tell me how i delete the file from

"C:\CASTLE\NORTH WEST\"

after copying it.

Also i don't want to be prompted if i want to delete the file.

Cheers


---
Message posted from http://www.ExcelForum.com/




Tim Coddington

How to load these XLS files
 
Oops. Sorry. Name doesn't work across devices. I guess you do need the
KILL after all.

"Tim Coddington" wrote in message
...
Name is actually a move, not a copy. I'm sure you could do the
name command, then open the sheet on the D: drive to use it. A
little modification of Tom's code should do the trick.

But, for future reference, the keyword to look up in help is KILL.

"Jako " wrote in message
...
Many thanks that works a treat.

Could you please tell me how i delete the file from

"C:\CASTLE\NORTH WEST\"

after copying it.

Also i don't want to be prompted if i want to delete the file.

Cheers


---
Message posted from http://www.ExcelForum.com/







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

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