I would like to insert code to launch a default browser in a new SMALL window from within my Excel spreadsheet. Has anyone done this before?
I can already launch my default browser using a SHELL and/or FollowHyperLink statement but I need my Excel spreadsheet to remain in focus. If possible I'd like to add it to my existing browser call:
ThisWorkbook.FollowHyperLink("h.......")
You can use a WebBrowser control. This may need to be added to the ActiveX controls. Go to Developer Tab > Insert > More Controls > Microsoft Web Browser.
To control the WebBrowser, use the .Navigate2 (string) command
strWebsite = "www.google.com"
Sheet1.WebBrowser1.Navigate2 (strWebsite)
Related
I'm attempting to use VBA to transfer data from an Excel sheet to a number of input boxes on a webpage. Due to a couple of considerations specific to this site it would be much, much easier if I could simply log in to the webpage manually then use Selenium (or whatever) to take control of the browser window and execute the data entry tasks. My impression is that this was quite doable with Internet Explorer, but that's been phased out, and it looks like there's not a very robust method for doing this with Google Chrome. Is there a way to do this with Edge?
I managed to get half of the data entered using the AppActivate statement and a series of SendKeys commands - this was with Chrome - but that approach won't work for the rest of it, since AppActivate doesn't seem to really commandeer the browser window in a way that allows Selenium to click buttons etc.
Yes you can use control browser with selenium Basic. You can follow instruction on how to get it working with vba here. https://simpleexcelvba.com/google-chrome-automation-with-selenium-basic/#:~:text=Selenium%20Basic%20is%20a%20Selenium,by%20double%2Dclicking%20on%20it.
I want to make some auto fill form from excel to web page. First I try to switch from Excel to web page by click Alt+Tab. I used this code Send Keys ("%{TAB}%"). It's work fine in that day, but when i will continue my program in next day, the code is not working anymore.
(Note
I don't use code
IE.navigate URL
from excel to access web page , because that page is child link and i don't know the address)
I work in excel 2010
I used this code
Application.SendKeys ("%{TAB}%")
How to fix that error or if any another code to switch from excel to webpage.
you need to use Alt+Tab to switch window, use this code, it works for me
Application.SendKeys "%{TAB}", True
I have made an Excel add-in, which pops up a window either by window.open or Dialog API.
I just tested it in Excel for Mac: when the window is opened, it seems that we can NOT put the focus back to Excel or the add-in taskpane; we have to close the window before choosing Excel or the add-in taskpane.
Does anyone know if there is a way to enable switching focus between popup window and Excel?
The dialog window is a modal in nature that forces the user to interact with it before they can go back to using the parent add-in/Office host. For interaction that requires back-n-forth with Excel, task-pane is the right place for UI.
The dialog API is meant to always show the dialog on top of other items. In terms of modality, you are correct that in Windows the dialog allows you to still interact with the spreadsheet while in other platforms, like Mac or Online is fully modal (cannot switch back to the spreadsheet). My recommendation is to design your add-in accounting for multi-platform so assume the dialog is modal in all platforms. As Sudhi recommends in his response, if your interaction requires the user to use the add-in and the spreadsheet back and forth, using a pane is a better model.
Testing a website that has links to various forms. PDF forms work fine as long as I use the “goBackAndWait” command. However if the document is a Word or Excel document, clicking the link opens the document in a new window (not a pop up window). Using the “close” command closes the main window and not the document window.
How to close or open the Excel or word file using Selenium IDE and go back to the page.
Note that the Selenium IDE cannot interact with embedded objects by default.
I can offer you an alternative. Instead of opening the window, I recommend that you just check the URL of the links that you are clicking, and that the href points to the appropriate document extension.
Pseudo:
validatePresent | css=#doclink[href$='.docx']
I am developing a Excel plugin. It works all right for Excel versions before 2013. But a lot of features is broken when it runs against Excel 2013. I found the root cause is all windows are running in only one process in Excel 2013. Even if user explicitly launch a new window by double-clicking the shortcut on the desktop or by clicking the item in the start menu, no new process is created.
This results in the status conflict between processes. Status bar and ribbon is shared. For instance, when I update the status bar information in one window, the other windows' are also updated. When I check/uncheck a ribbon button in one window, the other windows' buttons are also checked/unchecked.
I think a possible solution is to change some configurations to make it work as before. But I found nothing relevant by searching on google.
Does anyone know how to make it or is there any other solution?
With Excel 2013, the default you have is to create a new window within the existing Excel process. In order to force the creation of a separate instance of the Excel process, you have these options:
Option 1
From the command prompt, run EXCEL /X and you will open Excel window as a new instance. The /X command switch forces the creation of a new instance.
Option 2
Right click on the Excel icon in Windows taskbar
Go down to where it lists the application
Hold down the ALT key on the keyboard and click "Excel 2013/2016"
It should give you this prompt, "Do you want to start a new instance of Excel?"
Click "Yes!"
Option 3
Use this technique to open an existing document directly:
Hold down Alt.
Right click Excel file.
Click Open.
Continue holding down Alt until the "Do you want to start a new instance of Excel" dialogue pops up.
Click Yes.
For more detail,please visit:
http://sqlblog.com/blogs/marco_russo/archive/2012/07/24/running-excel-2013-in-a-separate-instance-excel-powerpivot.aspx
re. "Right click on the Excel Tab in Windows taskbar keeping the ALT key pressed"
-This option is not available in Windows 10 with Excel 2016.
However, the Excel /X option works and a second change-undo buffer is created, as noted above, in the new process.