Is there a list of Bloomberg DDE commands? - bloomberg

I'm trying to interface with Bloomberg Pro using DDEExecute but I'm having trouble finding a list of valid DDE commands.
In particular what I'm hoping to do right now is enter specific non-character keystrokes (e.g. "right arrow")

I agree with others that API is the way to go, but if for some reason you do not have the data, you can use a few different approaches including DDE or Sendkeys. I don't believe there is a list though, as bloomberg has said "Although the DDE and SendKeys functionality is documented here, we are unable to assist with specific uses of this functionality"
SendKeys method can be used in the following way:
' Activate a Bloomberg Professional Window (Window #1, in this case)
AppActivate "1-BLOOMBERG"
' Send commands to the Bloomberg Professional service Window
SendKeys "{ESC}" & "MSFT US {f8} DES~", True
Additional help on the "SendKeys" methods [Syntax of the keystrokes] can also be found in the MSDN Library - VBA Help Files, as well as in the Add-Ins Help file. This file can be opened from the Windows task bar by clicking the START menu and then Programs|Bloomberg.
The list including right arrow can be found here.

Related

Open find and replace dialog in the IDE

Is there any way to open the Find and Replace dialog in the Access VBA IDE programmatically? To be clear, not F&R on a form or control but in the code window itself? Access doesn't have SendKeys and I can't find any command to do it.
Reason I ask is I have an ultrawide monitor and the dialog always opens in the top left of the screen. I'd like to use WinApi's SetWindowPos to reposition it as I use F&R a lot in my current project. I'm considering rolling my own function using VBE Extensibility but checking here first for a quick solution.
Not that I know of, but you could check out MZ-Tools.
Its Find/Replace window at least opens where you left it:

Using code to automatically click a mouse

I'm working with a Bloomberg data sheet and I need to export this sheet into Excel. The only way of doing so is through clicking the "export" button in the Bloomberg window. Is there any way to use code to accomplish this click. I would appreciate help with 1) indicating which coding language should be used 2) the physical code syntax that can accomplish my goal
I've tried using VBA, but there is no automatic control of the mouse.
There are two alternatives you may use to simulate mouse and keyboard automation on Windows platform.
AutoHotKey
AutoIT
I would personally recommend using AutoHotKey. It has a very extensive documentation and a fairly active community.
Additionally, please try to use keyboard shortcuts (E.g Alt+F) instead of mouse movements. If you're using keyboard shortcuts, you'll be less prone to unwanted behaviour.
Extra: If you have a web application, you may use Selenium. It works neatly with Java or Python.

VBA to choose "save" option on download on IE

I'm using VBA to open an Internet Explorer window, navigate and log into a webpage and download an Excel Spreadsheet. Every bit of the process works fine, but I can't find a way to automate the process of choosing the "save" option everytime I try to download something on IE.
Here's the code I've been using, found it here, I know I can set VBA to send Alt+S automatically, but it won't work when IE is not in focus and I just couldn't find a way on the web that works.
AppActivate "Internet Explorer"
Application.SendKeys "%{S}"
Is there another way to do it? Without Sending Keys? Or a working way to send keys?
I appreciate any help!
Observations: I'm using IE 11 and can't tinker with it's settings, because I'm not the administrator.

Excel Macro to get by Security PopUp

I am trying to write a macro to log into a website but I keep getting stopped by a security alert pop up that requires me to click OK to continue. Any idea what lines to put in to make it click on the OK button so I can proceed to the site?
If you want to stick with VBA, a few options come to mind. The quick and dirty approach would just be to use Sendkeys, and send Enter. It's super unreliable though, but may work in your specific case.
Another option is using windows APIs to send/post the relevant message to the window. See here
The final option I'll offer is considering Authotkey as a language stand-in. It makes this type of interaction really easy. It has COM support, so you can still use Excel, just like VBA.
http://www.contextures.com/excelvbasendkeys.html
SendKeys should be able to do this I think...
SendKeys "~"
O

How can I send clicks or keys from a VB6 app to an Excel dialog box?

My employer has purchased a third-party tool, OfficeConverter from Conveter Technology that automates the conversion / repair of Office 2003-formatted files to Office 2007 format. This tool also highly automates the translation / change in macro / VBA code requirements between Office 2003 and 2007 formats.
My problem is that during this conversion the tool is opening the targeted Office product, say Excel and is then opening the target user file (ie. Report.xls) and is then examining any VBA / macro code for change requirements. The problem is that IF the Excel file code is dependent upon some external tool like an .OCX file and if that tool doesn't exist on the PC that I'm performing this action on, Excel will pop up a message that the Object has not been found, stopping the entire conversion process (thousands of files in a row) until someone comes along and MANUALLY clicks the appropriate button to close the dialogue box.
I figured that creating a small watching application in VB6 (hey, I'm old and my skills are too) could sit on the same PC and watch for these dialogue boxes and, depending on the specific message, click the appropriate button via the SendMessage API call.
The problem is that I haven't been able to get SendMessage to actually PUSH the button for me, I've tried sending it the Return key value (vbKeyReturn) or even the Space key (vbKeySpace) but the action never results in the dialogue box closing like it should. I can get the focus to tab between whichever buttons on the dialogue box are enabled, but that is about it.
I've attempted to use SendKeys, but that is far less reliable and strongly discouraged in the current documentation that I've come across.
Any suggestions? :)
If you have the hWnd for the button, and the machine is unattended, you can easily use MouseEvent to move the cursor over the button and click it. This sample includes a drop-in ready module that'll do the dirty work for you given just the window handle:
http://vb.mvps.org/samples/MouseEvent
Otherwise, the most straightforward way is probably to just send WM_LBUTTONDOWN and WM_LBUTTONUP sequentially.
EDIT: If you "just want to get it done" take Jim's advice and try Gary Chanson's Window Demon tool.
Take a look at this utility "Window Demon" by Gary Chanson
Karl: how quickly we forget our pals!
I would suggest taking a look at AutoIt.
It is perfect for this task, look for a window with a particular text on it and click a button.
Runs in the system tray as a standalone application.