hungttri Posted April 4, 2016 Share Posted April 4, 2016 Hi, I'm have a func to search for new Data. And every day I'm download new excel file from Email to "Shop" folder. Then I used Script to Search for new Data. Now I would creat a Func to update that new data to my database. Please help me!!! Thank you and sorry for my bad english! Here I'm Example for 4 data. Realistic I'm have more. Quote Local TB[100] TB[1]="Hoang Hoa Tham.xlsx" TB[2]="Truong Chinh.xlsx" TB[3]="Pham Van Hai.xlsx" TB[4]="Cong Hoa" ;.................. Search() Func Search() Local $Tim = FileFindFirstFile("C:\Users\My PC\Desktop\Shop\*.*"); If $Tim = -1 Then MsgBox(0, "Error", "File Not found.",1) Exit EndIf Local $File = "", $iResult = 0 While 1 $File = FileFindNextFile($Tim) Select Case $File=$TB[1] or or $File=$TB[2] or $File=$TB[3] or $File=$TB[4] Sleep(10) Case Else MsgBox($MB_SYSTEMMODAL, "", '"'&$File&'" Is new Data, Do you want to update to Database') Exit EndSelect WEnd EndFunc Link to comment Share on other sites More sharing options...
iamtheky Posted April 4, 2016 Share Posted April 4, 2016 (edited) Help me func upate data Started by hungttri, 15 minutes ago funcupate sounds dirty. Needing helping funcupating something else sounds even dirtier. Edited April 4, 2016 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
InunoTaishou Posted April 4, 2016 Share Posted April 4, 2016 I don't know what data you're trying to update. I'm assuming you're trying to read the xlsx file? Check out the Excel UDF. Link to comment Share on other sites More sharing options...
hungttri Posted April 4, 2016 Author Share Posted April 4, 2016 Like this: My database is List.xls Everyday I'm download Report folder on internet from my employee My Script will search if file name in Report folder not equal any name data from List.xls then show message box and... ...I want when click button: new Name will update to excel file. Link to comment Share on other sites More sharing options...
alien4u Posted April 4, 2016 Share Posted April 4, 2016 With your code you find for new files on a directory, thats it, but how do you know there is new data? If you need to look inside the files and that are excel files then you need Excel UDF as @InunoTaishou already said. Try to explain better what you want to do. Kind Regards Alien. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now