How can I launch a VBA script from within Firefox on Windows XP? - firefox

I'd like to do the following:
In Mozilla Firefox by clicking a button or pressing a shortcut the URL of the current browser tab is copied and then Microsoft Excel (XP) is opened and a VBA script is launched, which takes the URL as an argument.
How can I do that?

It sounds like your VBA script is in an Excel spreadsheet, and you want it to automatically execute when you invoke the .xls(x) from Firefox.
If so, you can try this:
1) Write your VBA as an "Auto_Open macro" or use the "Open" event on your worksheet:
http://office.microsoft.com/en-us/excel-help/running-a-macro-when-excel-starts-HA001034628.aspx
2) Make sure your Windows file associations are set so that Firefox will open your .xls(x) file or link with MS Excel
3) You can use a file URL, format file://host/path to link to the document

Related

Forcing a launcher to be opened with Internet Explorer

Ok, I've read here and here that is not possible, on a gerneral browser, to force a link to be opened in IE.
So my question is: can I do it with a desktop launcher?
Extended question: Can I easily create a desktop launcher on Windows (10, 7 and maybe older versions) that if double clicked opens a specific URL in IE?
You can create a batch file to run the command to open IE with a specific url. You can create a .bat file and put the following code in the file:
start iexplore "http://www.bing.com"
Double click the .bat file, then it will open IE with Bing website.
Result:

Is it possible to get ie to render a document as html with an extension that is not .htm or .html? (Windows)

I am trying to get an html document that's saved on the file system to run through a vbscript first (to check for script injection) and then open in Internet Explorer if the check passes. I have written the vbscript as well as a .bat to call the script, and all of this works when I don't change the file extension (.htm or .html) but do "open with..." and select my .bat file - the vbscript opens it in IE. But when I change the file extension, IE automatically opens the download dialog instead of rendering the html. I want to use a custom extension as a way of only running certain html docs through my script.
So my question is: Is there a way to get Internet Explorer to recognize and render the document in a file with a custom extension?
CatCat's comment about setting the MIME type is the right answer

Invoke 'Open' Dialog from Windows Desktop

Is there some way I can programmatically (in VBS) OR by using CMD/RUN open the 'Open' dialog that contains the places bar and a browser but without opening say notepad or MSpaint?
http://i.technet.microsoft.com/dynimg/IC354177.jpg
I'd like to use this on the desktop itself, it would be really cool if there was a DLL I can just use instead of having a VBS file but if not i'm sure its possible in VBS.
I'm busy searching where the actual open dialog box comes from, it should come from some DLL file somewhere.
I might even consider stopping the windows shell from opening all together and just using this open window as the shell on some computers.
Regards, Rocklore
What version of Windows are you on?
"UserAccounts.CommonDialog" was the way to do this in XP. But it no longer exists in Windows 7. You may be able to use some of the flags available for the BrowseForFolder() method to make it look like a file open dialog. See this page for an example.
XP Edit:
Here's an XP example using UserAccounts.CommonDialog.
With CreateObject("UserAccounts.CommonDialog")
.InitialDir = CreateObject("WScript.Shell").SpecialFolders("Desktop")
.Filter = "All Files|*.*"
' Show the dialog. If [Open] is clicked, save the name of the selected file...
If .ShowOpen Then strFile = .FileName
End With

how to detect programmatically when a powerpoint slideshow starts

I would like to write a windows program that would enable the user to choose a ppt file. When that ppt file starts the slideshow, my program would automatically display some message in front of the slideshow. When the slideshow is over, my program would close itself. What do I need to learn to write this program?
I'm not good with VBS (which I'm sure you could use for this) but if you set your show's extensions to .PPS instead of .PPT that will force them to start playing automatically on open. Then you won't need to see when the show starts because you'll control that.
As for opening it, if you write BATCH script you can use it to prompt for a file location but it will all be manually typed because it will load from the command window. If a show opens, the command screen can stay open until that slideshow closes, then continue with the next line of script.
Depending on if these are your powerpoints that you want opened, I personally would put VBA script in them to trigger On_Open and On_Close That will get you a clean customizable popup error message.
Edit
After doing some quick searching the On_Open and On_Close is not found in PPT, you would need to install an add-in.

No control to new browser window while swiched to it

In my automation, I have to click on a button which opens a new browser instance with search results, and from that window, I have to select a video to upload. I switched to the window using:
driver.switch_to_window( "File Upload" )
In order to upload a video, I have to select the video from that window, but I can't, as there is no way to access that window. Is there any way in selenium webdriver with Ruby or some other plugin or tool I can achieve this?
The file upload windows are usually system windows and selenium/webdriver cannot be used to interact with it. In Java, sendkeys is used to type the link to the file being uploaded. You can try using an equivalent function (something that you use to type data in any textfield etc function) to directly give the link to your video file.
Hope it helps..

Resources