Re: $$Excel-Macros$$ Help required for changing the file name in a query programmatically

2014-08-30 Thread Eugene Bernard
Mr Basole,

Thanks for the attachements,

I am getting an error msg as in the attachment, even after adding Ms-ado
object library.

[image: Inline image 1]

TIA.

Eugene



On Fri, Aug 29, 2014 at 11:06 PM, Ricardo® ricardo...@gmail.com wrote:

 Ok, is attached files.
 To test, hold the 2 files in the same folder

 Regards,

 Basole.


 2014-08-29 11:58 GMT-03:00 Eugene Bernard eugene.bern...@gmail.com:

 Basole,

 Thanks for your solution.

 Can you please send me the working example along with excel file with
 sample data.

 I tried your code with my data, and i am getting an error message.

 Regards
 Eugene


 On Saturday, August 23, 2014 7:04:59 PM UTC+5:30, Basole wrote:

 Hi,

 See this example extracts the data from your file T2308.xls (T  date:
 and change the name according to the current(or system date)), using
 ADO and SQL statement.

 regards.


 Basole



 2014-08-23 8:55 GMT-03:00 Eugene Bernard eugene@gmail.com:

 Dear all,

 I am daily using the attached sample query file to extract data from an
 excel file stored in my windows desktop.

 I am pasting below a part of code from the test.dqy file, where I am
 daily changing the file name based on the date on which it is being run.

 Instead of changing it manually, is there any possibility to change it
 based on the system date.

 ie T2408 in place of T2308 if I run the query on 23/08/2014.

 SELECT `Sheet1$`.Date, `Sheet1$`.DptNo, `Sheet1$`.Empno, `Sheet1$`.Leave
 FROM `C:\Users\jeb501\Desktop\T2308.xls`.`Sheet1$` `Sheet1$`  WHERE
 (`Sheet1$`.DptNo='01')
  Note : I am using EXCEL 2007

 TIA

 Eugene

 --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
 It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners
 and members are not responsible for any loss.
 ---
 You received this message because you are subscribed to the Google
 Groups MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to excel-macros...@googlegroups.com.
 To post to this group, send email to excel-...@googlegroups.com.

 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.


  --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
 =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners and
 members are not responsible for any loss.
 ---
 You received this message because you are subscribed to the Google Groups
 MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to excel-macros+unsubscr...@googlegroups.com.

 To post to this group, send email to excel-macros@googlegroups.com.
 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.


  --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
 =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners and
 members are not responsible for any loss.
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups MS EXCEL 

Re: $$Excel-Macros$$ Help required for changing the file name in a query programmatically

2014-08-30 Thread Eugene Bernard
Dear Basole,

Please ignore my earlier mail,

I removed the slash in between dd/mm from the below statement from your
example

fileXLS = T  Replace(Format(Date, dd/mm), /, )  .xls  like
below,

fileXLS = T  Replace(Format(Date, ddmm), /, )  .xls and example
sent by you

started working.

Thank you very much.

Eugene








On Fri, Aug 29, 2014 at 11:06 PM, Ricardo® ricardo...@gmail.com wrote:

 Ok, is attached files.
 To test, hold the 2 files in the same folder

 Regards,

 Basole.


 2014-08-29 11:58 GMT-03:00 Eugene Bernard eugene.bern...@gmail.com:

 Basole,

 Thanks for your solution.

 Can you please send me the working example along with excel file with
 sample data.

 I tried your code with my data, and i am getting an error message.

 Regards
 Eugene


 On Saturday, August 23, 2014 7:04:59 PM UTC+5:30, Basole wrote:

 Hi,

 See this example extracts the data from your file T2308.xls (T  date:
 and change the name according to the current(or system date)), using
 ADO and SQL statement.

 regards.


 Basole



 2014-08-23 8:55 GMT-03:00 Eugene Bernard eugene@gmail.com:

 Dear all,

 I am daily using the attached sample query file to extract data from an
 excel file stored in my windows desktop.

 I am pasting below a part of code from the test.dqy file, where I am
 daily changing the file name based on the date on which it is being run.

 Instead of changing it manually, is there any possibility to change it
 based on the system date.

 ie T2408 in place of T2308 if I run the query on 23/08/2014.

 SELECT `Sheet1$`.Date, `Sheet1$`.DptNo, `Sheet1$`.Empno, `Sheet1$`.Leave
 FROM `C:\Users\jeb501\Desktop\T2308.xls`.`Sheet1$` `Sheet1$`  WHERE
 (`Sheet1$`.DptNo='01')
  Note : I am using EXCEL 2007

 TIA

 Eugene

 --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
 It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners
 and members are not responsible for any loss.
 ---
 You received this message because you are subscribed to the Google
 Groups MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to excel-macros...@googlegroups.com.
 To post to this group, send email to excel-...@googlegroups.com.

 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.


  --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
 =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners and
 members are not responsible for any loss.
 ---
 You received this message because you are subscribed to the Google Groups
 MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to excel-macros+unsubscr...@googlegroups.com.

 To post to this group, send email to excel-macros@googlegroups.com.
 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.


  --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
 =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum 

Re: $$Excel-Macros$$ Help required for changing the file name in a query programmatically

2014-08-30 Thread Ricardo®
Was precisely the error: problem with the file name. * xls.
To work well, every day change the name, for example: 31/08/2014 and rename
to (T3108.xls).
Then do the test with your file. If you have any problems, please send me
an example of your file (Tddmm.xls).

Regards,


Basole.


2014-08-30 12:17 GMT-03:00 Eugene Bernard eugene.bern...@gmail.com:

 Dear Basole,

 Please ignore my earlier mail,

 I removed the slash in between dd/mm from the below statement from your
 example

 fileXLS = T  Replace(Format(Date, dd/mm), /, )  .xls  like
 below,

 fileXLS = T  Replace(Format(Date, ddmm), /, )  .xls and
 example sent by you

 started working.

 Thank you very much.

 Eugene








 On Fri, Aug 29, 2014 at 11:06 PM, Ricardo® ricardo...@gmail.com wrote:

 Ok, is attached files.
 To test, hold the 2 files in the same folder

 Regards,

 Basole.


 2014-08-29 11:58 GMT-03:00 Eugene Bernard eugene.bern...@gmail.com:

 Basole,

 Thanks for your solution.

 Can you please send me the working example along with excel file with
 sample data.

 I tried your code with my data, and i am getting an error message.

 Regards
 Eugene


 On Saturday, August 23, 2014 7:04:59 PM UTC+5:30, Basole wrote:

 Hi,

 See this example extracts the data from your file T2308.xls (T  date:
 and change the name according to the current(or system date)), using
 ADO and SQL statement.

 regards.


 Basole



 2014-08-23 8:55 GMT-03:00 Eugene Bernard eugene@gmail.com:

 Dear all,

 I am daily using the attached sample query file to extract data
 from an excel file stored in my windows desktop.

 I am pasting below a part of code from the test.dqy file, where I am
 daily changing the file name based on the date on which it is being run.

 Instead of changing it manually, is there any possibility to change it
 based on the system date.

 ie T2408 in place of T2308 if I run the query on 23/08/2014.

 SELECT `Sheet1$`.Date, `Sheet1$`.DptNo, `Sheet1$`.Empno, `Sheet1$`.Leave
 FROM `C:\Users\jeb501\Desktop\T2308.xls`.`Sheet1$` `Sheet1$`  WHERE
 (`Sheet1$`.DptNo='01')
  Note : I am using EXCEL 2007

 TIA

 Eugene

 --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
 It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum
 @ https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like
 Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need
 Advice will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners
 and members are not responsible for any loss.
 ---
 You received this message because you are subscribed to the Google
 Groups MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to excel-macros...@googlegroups.com.
 To post to this group, send email to excel-...@googlegroups.com.

 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.


  --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
 It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners and
 members are not responsible for any loss.
 ---
 You received this message because you are subscribed to the Google
 Groups MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to excel-macros+unsubscr...@googlegroups.com.

 To post to this group, send email to excel-macros@googlegroups.com.
 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.


  --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
 =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be 

Re: $$Excel-Macros$$ Help required for changing the file name in a query programmatically

2014-08-30 Thread Bé Trần Văn
 At A7 sheet Homepage, select Office. GET FILE button to select the file and
get into



2014-08-30 22:10 GMT+07:00 Eugene Bernard eugene.bern...@gmail.com:

 Mr Basole,

 Thanks for the attachements,

 I am getting an error msg as in the attachment, even after adding Ms-ado
 object library.

 [image: Inline image 1]

 TIA.

 Eugene



 On Fri, Aug 29, 2014 at 11:06 PM, Ricardo® ricardo...@gmail.com wrote:

 Ok, is attached files.
 To test, hold the 2 files in the same folder

 Regards,

 Basole.


 2014-08-29 11:58 GMT-03:00 Eugene Bernard eugene.bern...@gmail.com:

 Basole,

 Thanks for your solution.

 Can you please send me the working example along with excel file with
 sample data.

 I tried your code with my data, and i am getting an error message.

 Regards
 Eugene


 On Saturday, August 23, 2014 7:04:59 PM UTC+5:30, Basole wrote:

 Hi,

 See this example extracts the data from your file T2308.xls (T  date:
 and change the name according to the current(or system date)), using
 ADO and SQL statement.

 regards.


 Basole



 2014-08-23 8:55 GMT-03:00 Eugene Bernard eugene@gmail.com:

 Dear all,

 I am daily using the attached sample query file to extract data
 from an excel file stored in my windows desktop.

 I am pasting below a part of code from the test.dqy file, where I am
 daily changing the file name based on the date on which it is being run.

 Instead of changing it manually, is there any possibility to change it
 based on the system date.

 ie T2408 in place of T2308 if I run the query on 23/08/2014.

 SELECT `Sheet1$`.Date, `Sheet1$`.DptNo, `Sheet1$`.Empno, `Sheet1$`.Leave
 FROM `C:\Users\jeb501\Desktop\T2308.xls`.`Sheet1$` `Sheet1$`  WHERE
 (`Sheet1$`.DptNo='01')
  Note : I am using EXCEL 2007

 TIA

 Eugene

 --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
 It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum
 @ https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like
 Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need
 Advice will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners
 and members are not responsible for any loss.
 ---
 You received this message because you are subscribed to the Google
 Groups MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to excel-macros...@googlegroups.com.
 To post to this group, send email to excel-...@googlegroups.com.

 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.


  --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
 It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners and
 members are not responsible for any loss.
 ---
 You received this message because you are subscribed to the Google
 Groups MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to excel-macros+unsubscr...@googlegroups.com.

 To post to this group, send email to excel-macros@googlegroups.com.
 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.


  --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
 =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a 

Re: $$Excel-Macros$$ Help required for changing the file name in a query programmatically

2014-08-29 Thread Eugene Bernard
Basole,

Thanks for your solution.

Can you please send me the working example along with excel file with 
sample data.

I tried your code with my data, and i am getting an error message.

Regards
Eugene

On Saturday, August 23, 2014 7:04:59 PM UTC+5:30, Basole wrote:

 Hi, 

 See this example extracts the data from your file T2308.xls (T  date: and 
 change the name according to the current(or system date)), using ADO and 
 SQL statement.

 regards.


 Basole



 2014-08-23 8:55 GMT-03:00 Eugene Bernard eugene@gmail.com 
 javascript::

 Dear all,
  
 I am daily using the attached sample query file to extract data from an 
 excel file stored in my windows desktop.
  
 I am pasting below a part of code from the test.dqy file, where I am 
 daily changing the file name based on the date on which it is being run.
  
 Instead of changing it manually, is there any possibility to change it 
 based on the system date.
  
 ie T2408 in place of T2308 if I run the query on 23/08/2014.
  
 SELECT `Sheet1$`.Date, `Sheet1$`.DptNo, `Sheet1$`.Empno, `Sheet1$`.Leave  
 FROM `C:\Users\jeb501\Desktop\T2308.xls`.`Sheet1$` `Sheet1$`  WHERE 
 (`Sheet1$`.DptNo='01')
 Note : I am using EXCEL 2007
  
 TIA
  
 Eugene

 -- 
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? 
 It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
 https://www.facebook.com/discussexcel
  
 FORUM RULES
  
 1) Use concise, accurate thread titles. Poor thread titles, like Please 
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice 
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security 
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.
  
 NOTE : Don't ever post confidential data in a workbook. Forum owners and 
 members are not responsible for any loss.
 --- 
 You received this message because you are subscribed to the Google Groups 
 MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to excel-macros...@googlegroups.com javascript:.
 To post to this group, send email to excel-...@googlegroups.com 
 javascript:.
 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.




-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups MS 
EXCEL AND VBA MACROS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.


Re: $$Excel-Macros$$ Help required for changing the file name in a query programmatically

2014-08-29 Thread Ricardo®
Ok, is attached files.
To test, hold the 2 files in the same folder

Regards,

Basole.


2014-08-29 11:58 GMT-03:00 Eugene Bernard eugene.bern...@gmail.com:

 Basole,

 Thanks for your solution.

 Can you please send me the working example along with excel file with
 sample data.

 I tried your code with my data, and i am getting an error message.

 Regards
 Eugene


 On Saturday, August 23, 2014 7:04:59 PM UTC+5:30, Basole wrote:

 Hi,

 See this example extracts the data from your file T2308.xls (T  date:
 and change the name according to the current(or system date)), using ADO
 and SQL statement.

 regards.


 Basole



 2014-08-23 8:55 GMT-03:00 Eugene Bernard eugene@gmail.com:

 Dear all,

 I am daily using the attached sample query file to extract data from an
 excel file stored in my windows desktop.

 I am pasting below a part of code from the test.dqy file, where I am
 daily changing the file name based on the date on which it is being run.

 Instead of changing it manually, is there any possibility to change it
 based on the system date.

 ie T2408 in place of T2308 if I run the query on 23/08/2014.

 SELECT `Sheet1$`.Date, `Sheet1$`.DptNo, `Sheet1$`.Empno, `Sheet1$`.Leave
 FROM `C:\Users\jeb501\Desktop\T2308.xls`.`Sheet1$` `Sheet1$`  WHERE
 (`Sheet1$`.DptNo='01')
  Note : I am using EXCEL 2007

 TIA

 Eugene

 --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
 It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners
 and members are not responsible for any loss.
 ---
 You received this message because you are subscribed to the Google
 Groups MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to excel-macros...@googlegroups.com.
 To post to this group, send email to excel-...@googlegroups.com.

 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.


  --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
 =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners and
 members are not responsible for any loss.
 ---
 You received this message because you are subscribed to the Google Groups
 MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to excel-macros+unsubscr...@googlegroups.com.
 To post to this group, send email to excel-macros@googlegroups.com.
 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.


-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups MS 
EXCEL AND VBA MACROS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at 

$$Excel-Macros$$ Help required for changing the file name in a query programmatically

2014-08-23 Thread Eugene Bernard
Dear all,

I am daily using the attached sample query file to extract data from an
excel file stored in my windows desktop.

I am pasting below a part of code from the test.dqy file, where I am daily
changing the file name based on the date on which it is being run.

Instead of changing it manually, is there any possibility to change it
based on the system date.

ie T2408 in place of T2308 if I run the query on 23/08/2014.

SELECT `Sheet1$`.Date, `Sheet1$`.DptNo, `Sheet1$`.Empno, `Sheet1$`.Leave
FROM `C:\Users\jeb501\Desktop\T2308.xls`.`Sheet1$` `Sheet1$`  WHERE
(`Sheet1$`.DptNo='01')
Note : I am using EXCEL 2007

TIA

Eugene

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups MS 
EXCEL AND VBA MACROS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.


Test.dqy
Description: Binary data


Re: $$Excel-Macros$$ Help required for changing the file name in a query programmatically

2014-08-23 Thread Ricardo®
Hi,

See this example extracts the data from your file T2308.xls (T  date: and
change the name according to the current(or system date)), using ADO and
SQL statement.

regards.


Basole



2014-08-23 8:55 GMT-03:00 Eugene Bernard eugene.bern...@gmail.com:

 Dear all,

 I am daily using the attached sample query file to extract data from an
 excel file stored in my windows desktop.

 I am pasting below a part of code from the test.dqy file, where I am daily
 changing the file name based on the date on which it is being run.

 Instead of changing it manually, is there any possibility to change it
 based on the system date.

 ie T2408 in place of T2308 if I run the query on 23/08/2014.

 SELECT `Sheet1$`.Date, `Sheet1$`.DptNo, `Sheet1$`.Empno, `Sheet1$`.Leave
 FROM `C:\Users\jeb501\Desktop\T2308.xls`.`Sheet1$` `Sheet1$`  WHERE
 (`Sheet1$`.DptNo='01')
 Note : I am using EXCEL 2007

 TIA

 Eugene

 --
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
 =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
 https://www.facebook.com/discussexcel

 FORUM RULES

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.
 2) Don't post a question in the thread of another member.
 3) Don't post questions regarding breaking or bypassing any security
 measure.
 4) Acknowledge the responses you receive, good or bad.
 5) Jobs posting is not allowed.
 6) Sharing copyrighted material and their links is not allowed.

 NOTE : Don't ever post confidential data in a workbook. Forum owners and
 members are not responsible for any loss.
 ---
 You received this message because you are subscribed to the Google Groups
 MS EXCEL AND VBA MACROS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to excel-macros+unsubscr...@googlegroups.com.
 To post to this group, send email to excel-macros@googlegroups.com.
 Visit this group at http://groups.google.com/group/excel-macros.
 For more options, visit https://groups.google.com/d/optout.


-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups MS 
EXCEL AND VBA MACROS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.


GetTdateExample.xlsm
Description: application/vnd.ms-excel.sheet.macroenabled.12