My current program that I am using, from excel, navigates to a web page where it downloads a lot of information. I primarily do this from excel because the data is in excel format.
I have it go to the page, click on a link and the open/save/cancel dialog box appears it automatically selects save and saves it to the last folder I saved anything in. Then it waits for the dialog box title to read "download complete" then close it and initiates the next download.
The issue I'm running in to, is that other people who use this program have the "close dialog box when download completes" option selected, and this interrupts the overall process.
Is there a way to change this setting from the excel VBA code, or will I need to explore a different method of dealing with this issue? Having the program do a direct download URL string is also not viable as the website needs to be logged in to and the request must come from the open window, (I have already attempted that method).
Use URLDownloadToFile to download from the internet, trying to use IE will lead to other issues:
VBA - URLDownloadToFile - Data missing in downloaded file
Related
I'm trying to automate the process of saving PDF invoices for bookkeeping purposes. The method suggested here does not work because a login is required to access the invoices.
I currently have a macro that navigates to the page, logs in and opens the links to each invoice. The URL scheme for these invoices is .../account/invoice/?invoice_number=XXXXXX. Navigating to each of these URL brings up the files in the
window. I would like the files to automatically save, but according to this page, the Always ask before opening this type of file option was depreciated from IE 10 and 11 due to security reasons.
I attempted to automatically click Save using this method, but the code here seems to be for a different version of IE.
The line:
hWnd = FindWindow("#32770", "File Download")
was modified to:
hwnd = FindWindow("#32770", "View Downloads - Windows Internet Explorer")
This successfully captures the download window, but it fails to find the &Save button for me to click. My guess would be that it's because there are multiple save buttons.
Any ideas would be greatly appreciated! Thanks.
I am writing a VBA macro to fill a web form with values from spreadsheet.
I have completed macro to fill all form fields except one to click on a button in form to Browse for files.
Below is the macro line to click the browse button.
IE.Document.getElementById("notification_picture").Click
I'm clueless on how to do the next steps i.e. to browse to a particular folder, select and open the file.
Any help is appreciated.
Man... particularly deal with IE is a pain...
You could use
Sendkeys "%S"
It will save it in Downloads folder and then you can move it, open or do whatever you want.
Many will say it is not good to use it because if the user change the focus while the macro is running it will not working, but it is the simplest way.
I've written an Excel addin that periodically checks a remote repository for data updates, including a check when the addin loads at Excel start up (during the addin's Workbook_Open event). If new respository data is detected, the addin asks the user for permission to proceed with the update. If the user clicks "yes", the addin successfully updates itself and everything is happy... except...
If Excel is not already running and the user selects an Excel file to open (e.g. via double-click in Windows), this sequence of events occurs and everything works, but the user-requested file opening is interrupted and not re-engaged. The Excel app is running, but with no workbook loaded (the workbook area is an empty frame).
I believe I have two options, neither of which I know how to accomplish:
Prevent the addin from completing its update check until the user-selected file has completed its open sequence and is fully loaded, or
Allow the addin to update itself and then somehow re-engage the user-selected file to complete the file open/load.
I have not been able to discover the filename/path of the user-requested file, so my addin isn't able to direct that file to be loaded.
My current workaround is a MsgBox telling the user to close Excel and re-open the selected file. Ideally, the addin update should occur and the original action should complete without requiring user intervention.
(Building on Option 1, I could start a delay timer for the addin to check for updates XX number of seconds after Excel starts, but this seems kludgy to me.)
Any guidance or ideas are appreciated. My interwebz searches aren't hitting the right combination of keywords for the exact scenario.
Instead of opening the new addin update file immediately you can use OnTime to delay it which should allow the other file to open successfully. See here: Process for updating Excel add-in?
In the answer you'll also see a reference to this package here which does everything you need. Autoupdates are hard so I would recommend going with someone else's solution.
http://www.decisionmodels.com/downloads.htm#addload
(Scroll down to Add-In Loader Version 2)
I'm currently trying to generate multiple forms in lotus notes via VBA in a specific database and send them for processing. Due to several notes scripts running when creating/processing the various forms, the only theoretical way that I can imagine this to work would be to have the user open a form, so that the VBA script can tell it to do copies through a button in the form (via the Windows API), then cycle through the open forms, fill them out and submit them one by one.
So far so good, but I'd need to be able to cycle through all the open forms in Notes in order to find the form I want to fill out and set is as active window. I can't seem to find any API that allows a user to go through all the open tabs in a notes window. Would anyone be able to help me on this one, please?
Many thanks in advance.
What you want to do is not possible. There is no way to "cycle" windows via code in Lotus Notes / IBM Notes.
Better turn around your processing: Instead of opening a form for editing just fill it in the backend. Then you don't need Windows API- calls and the Clipboard at all.
of course you can open the filled form afterwards to let the user fill in additional information, but this is not necessary at all as you can also save the document in backend.
I have a Word form that has a bunch of command buttons, form fields, and combo boxes. There is a lot of code associated with the form both in the "ThisDocument" object and another module I added.
If I open the form by double-clicking the document from Windows, it opens and works fine when I enable macros.
However, if I open Word first, and then go to File > Open to open the form, I get an error message "Can't Exit Design Mode because Control cmdInstructions can not be created.
I've seen this error on a few other users' computers also, and it sometimes refers to different controls, not just the cmdInstructions button.
This problem began when we upgraded to Word 2003. Again, if you double-click on the document in Windows to open it, there is no problem. The message only crops up when you have Word already open (with a blank new document).
Has anyone seen this problem before? What do I need to do to my code to avoid this problem?
It may be late, but the answer is to upgrade to Office 2003 Service Pack 3