Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default 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/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default 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/





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Files won't load from shortcut on email Boomer1 Excel Discussion (Misc queries) 2 June 21st 09 05:25 AM
How do I load files from a CD? Jamie Thompson[_2_] Excel Discussion (Misc queries) 3 January 21st 09 10:22 PM
75seconds to load excel files bri Excel Discussion (Misc queries) 5 October 26th 05 06:21 AM
xcel files will not automatically load xcel data file does not open automatical Setting up and Configuration of Excel 1 April 5th 05 07:55 AM
Load all files in a directory Greg B... Excel Discussion (Misc queries) 2 March 2nd 05 12:22 PM


All times are GMT +1. The time now is 02:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"