Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-11-20 16:06:09
Point:500 Replies:14 POST_ID:828433USER_ID:11059
Topic:
Visual Basic Programming;Web Browsers;Windows Vista
Dear EE ExpertS,
I get one website for download my data files and when I input edit my product No and press enter key ,the IE7
window will display data I want according to my input product No. , and so I try to do testing , I try to
disconnect internet and then after that I try to click its download button in the webpage,the download popup
window is still comming out or appear and I still be able to save the exact file I want after click save button .
So I wonder why I can save the file even I disconnect internet ,So I believe it is because when I input edit
the product NO and press enter key , the data file is fetched already into Cache file or memory in my PC before
I disconnect internet. So my question is if so, whether I am able to save my file without going through the
download or popup memu process that will help me to save a lot VBA download file program code and
exceute time with automation
I go to seach to my PC directory, finally I found one directory which is asynchronous to what I nagivate in IE7 before.
In such directory it has so many sitename and image, files name that I fire IE website before in recent days
The directory name is like C:usersmyaccountAppdataLocalMicrosoftWindowsTemporary Internet FilesConeten.IE5P5LBXH2C
something like that in Window Vista , it seems it is mirror or Cache file to my PC memory, Is it true ?
In other words, I am able to save files directly from the Temporary Internet Files directory,Is it Right ?
So if so, I am easier to use VBA and following code to check file is existed or not and copy it to my directory from
the Temp Internet File directory, Is it right ? Please advise
Since I have a lot of files want to download in target website, so I prefer to do it in VBA with everything in auto
that will save a lot of execute time when number of file to be download is huge like 1000 files
I try it before, but it is fail and it might be not as much as easy I say.. Or I ask where the Cache file is stored for internet file
in most in our PC 's memory and Cache file directory ? I know Cache file directory is just a link or mirror to direct our PC
memory location. are those files to be able to be saved by users ?
Please advise and Thanks
Duncan
I get one website for download my data files and when I input edit my product No and press enter key ,the IE7
window will display data I want according to my input product No. , and so I try to do testing , I try to
disconnect internet and then after that I try to click its download button in the webpage,the download popup
window is still comming out or appear and I still be able to save the exact file I want after click save button .
So I wonder why I can save the file even I disconnect internet ,So I believe it is because when I input edit
the product NO and press enter key , the data file is fetched already into Cache file or memory in my PC before
I disconnect internet. So my question is if so, whether I am able to save my file without going through the
download or popup memu process that will help me to save a lot VBA download file program code and
exceute time with automation
I go to seach to my PC directory, finally I found one directory which is asynchronous to what I nagivate in IE7 before.
In such directory it has so many sitename and image, files name that I fire IE website before in recent days
The directory name is like C:usersmyaccountAppdataLocalMicrosoftWindowsTemporary Internet FilesConeten.IE5P5LBXH2C
something like that in Window Vista , it seems it is mirror or Cache file to my PC memory, Is it true ?
In other words, I am able to save files directly from the Temporary Internet Files directory,Is it Right ?
So if so, I am easier to use VBA and following code to check file is existed or not and copy it to my directory from
the Temp Internet File directory, Is it right ? Please advise
Since I have a lot of files want to download in target website, so I prefer to do it in VBA with everything in auto
that will save a lot of execute time when number of file to be download is huge like 1000 files
I try it before, but it is fail and it might be not as much as easy I say.. Or I ask where the Cache file is stored for internet file
in most in our PC 's memory and Cache file directory ? I know Cache file directory is just a link or mirror to direct our PC
memory location. are those files to be able to be saved by users ?
Please advise and Thanks
Duncan
Function CheckFileAvailable(sFilePath) On Error Resume Next Dim oFS Dim oFile Set oFS = CreateObject("Scripting.FileSystemObject") Set oFile = oFS.OpenTextFile(sFilePath, 8, False) If Err.Number <> 0 Then CheckFileAvailable = "Fileinuse" ' Debug.Print "FileinUse" Else CheckFileAvailable = "Fileisfree" 'Debug.Print "FileisFree" End IfEnd FunctionSub CopyFile2File(wkdir As String, workbookname As String, wkdir2 As String, workbookname2 As String)Dim FsoSet Fso = CreateObject("Scripting.FileSystemObject")On Error GoTo Err Fso.CopyFile (wkdir & workbookname), wkdir2 & workbookname2 ' Change "*.*" to "*.xls" to move Excel Files only Exit SubErr: MsgBox "File path or Files not Found" Err.ClearEnd Sub 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:
Author: duncanb7 replied at 2024-12-06 03:09:49
The website is embeded with Java Applet Application and it is advance stream data system
I enter product No and press enter, and then through window to disconnect
internet that is really easy, and then click the download button and the file can saved to
my expect. I try many time for the testing, it is no problem at all.
I enter product No and press enter, and then through window to disconnect
internet that is really easy, and then click the download button and the file can saved to
my expect. I try many time for the testing, it is no problem at all.
Expert: imnorie replied at 2024-11-21 05:05:05
duncan
What are you actually trying to do?
Have you ever considered that there might be a reason why the data is displayed in an applet and is proving so difficult to download/access?
Also, have you checked you can't access the data via some other route.
What are you actually trying to do?
Have you ever considered that there might be a reason why the data is displayed in an applet and is proving so difficult to download/access?
Also, have you checked you can't access the data via some other route.
Accepted Solution
Expert: r3nder replied at 2024-11-20 20:14:25
500 points GOOD
Duncan
1 - GetWindoesCaption() - Gets the caption of the window that currently has focus
2 - boolOpenWindow = False - The window has already ben opened by the dialog box and sent on to download (that page doesnt need opening) Because you already have the file
R3nder
1 - GetWindoesCaption() - Gets the caption of the window that currently has focus
2 - boolOpenWindow = False - The window has already ben opened by the dialog box and sent on to download (that page doesnt need opening) Because you already have the file
R3nder
Author: duncanb7 replied at 2024-11-20 18:13:03
After disconnection, I try open new IE7, then web www.yahoo.com but it is not able
and click connection enable, the yahoo.com is activate back. So you don't worry about
the testing acurracy. We focus on the Cache Memory save into file system in Windows
and click connection enable, the yahoo.com is activate back. So you don't worry about
the testing acurracy. We focus on the Cache Memory save into file system in Windows
Author: duncanb7 replied at 2024-11-20 18:06:07
The question is how to save the Cache memory to my expect files without through the
download popup menu that will save might be more than 5 times running time.
For example, saving 0.1 seconds for 1 file and it imply save 100 seconds for 1000 files
If you need to do 300 iteration in one day,you will save 300*100 seconds=30000
ie, equal to 30000/60=500 minutes, In other words, you will save 8.3 hours daily
download popup menu that will save might be more than 5 times running time.
For example, saving 0.1 seconds for 1 file and it imply save 100 seconds for 1000 files
If you need to do 300 iteration in one day,you will save 300*100 seconds=30000
ie, equal to 30000/60=500 minutes, In other words, you will save 8.3 hours daily
Author: duncanb7 replied at 2024-11-20 18:02:28
That is why I believe the data is on Cahce after I enter No and press enter key and
the testing is also proving that is pretty sure
the testing is also proving that is pretty sure
Author: duncanb7 replied at 2024-11-20 18:00:16
I don't close IE7 windows, just go to click start in WIndow menu and click connection icon
and disable the connection, and then enable it, the stream data is activated back
and disable the connection, and then enable it, the stream data is activated back
Author: duncanb7 replied at 2024-11-20 17:58:47
The website is embeded with Java Applet Application and it is advance stream data system
I enter product No and press enter, and then through window to disconnect
internet that is really easy, and then click the download button and the file can saved to
my expect. I try many time for the testing, it is no problem at all.
I enter product No and press enter, and then through window to disconnect
internet that is really easy, and then click the download button and the file can saved to
my expect. I try many time for the testing, it is no problem at all.
Expert: Dave Baldwin replied at 2024-11-20 17:52:05
The file in the cache won't necessarily have the 'correct' file name. You would have to do a directory search to see if it's there.
"disconnect internet"? Are you unplugging the cable or just closing IE7 behind the file download dialog? If any part of IE is still showing on the screen including a 'Save' dialog, then it is not disconnected or closed.
"disconnect internet"? Are you unplugging the cable or just closing IE7 behind the file download dialog? If any part of IE is still showing on the screen including a 'Save' dialog, then it is not disconnected or closed.
Author: duncanb7 replied at 2024-11-20 17:36:59
I could not find the API defination of GetWindowCaption in API function.
COuld you provide more code detail ?
COuld you provide more code detail ?
Author: duncanb7 replied at 2024-11-20 17:34:36
Dear R3nder,
It seems your code is more efficent than more code, I get some question
1- GetWindowsCaption, what is for ?
2- boolOpenWindow = False ' Don't open the window it is already open
What is this of boolopenWIndow, you are able to save files without downlload window pop up
It seems your code is more efficent than more code, I get some question
1- GetWindowsCaption, what is for ?
2- boolOpenWindow = False ' Don't open the window it is already open
What is this of boolopenWIndow, you are able to save files without downlload window pop up
Author: duncanb7 replied at 2024-11-20 17:30:56
I am able to do whole automation downloading including related API function such as Postmessag, setcursorpos, sendmessage
etc.. But I don't want to do that, if the file is in Cahce memory I can direct copy the file into my directory from Cache memory
or Temp Internet File Directory. SInce ther is a lot ide time waiting using API function, for example, when postmessage
to simulate click donwload button, you need to wait the Dialog window display appear...etc.
So what is simple method to get download file if the file is already in memory or temp direcoty
I mean Disconnect, I try to disconnect internet after i enter product NO and enter key
etc.. But I don't want to do that, if the file is in Cahce memory I can direct copy the file into my directory from Cache memory
or Temp Internet File Directory. SInce ther is a lot ide time waiting using API function, for example, when postmessage
to simulate click donwload button, you need to wait the Dialog window display appear...etc.
So what is simple method to get download file if the file is already in memory or temp direcoty
I mean Disconnect, I try to disconnect internet after i enter product NO and enter key
Expert: Dave Baldwin replied at 2024-11-20 17:09:23
What do you mean by "disconnect internet"? Browsers usually start fetching files in the background while the 'Save' dialog is open. If it is a small file, it can finish downloading before the dialog is done. If it's a large file, it won't be done.
You can copy any files you want from the Temporary Internet Files directory. But IO suspect that VB is going to use the 'Temp' or 'TMP' directory for the initial download.
When it comes to downloading web sites or a lot of files, HTTrack http://www.httrack.com/ is a good program. You can download a whole website or just a directory.
You can copy any files you want from the Temporary Internet Files directory. But IO suspect that VB is going to use the 'Temp' or 'TMP' directory for the initial download.
When it comes to downloading web sites or a lot of files, HTTrack http://www.httrack.com/ is a good program. You can download a whole website or just a directory.
Expert: r3nder replied at 2024-11-20 16:55:21
Duncan
Here is a simple way to do it
Thanks
R3nder
Here is a simple way to do it
Thanks
R3nder
DoWinWnd = FindWindow(METSIMCLASSNAME, vbNullString)DoEventsLoop Until WinWnd <> 0 Or Now() > tBreakIf WinWnd <> 0 ThenlpWindowName = GetWindowsCaption(WinWnd)Debug.Print "metsim: " & lpWindowName & ", " & WinWndCall SetWindowPos(WinWnd, HWND_TOP, 0, 0, 0, 0, _SWP_NOSIZE Or SWP_NOMOVE Or SWP_SHOWWINDOW)Wait 1Call SendKeys("%(FO)~Y", True) ' Send File|Open command {Enter} YeshWndSelect = WinWndboolOpenWindow = False ' Don't open the window it is already openEnd If 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18: