Search:

Type: Posts; User: tahi.laci

Search: Search took 0.02 seconds.

  1. Program to solve for variable algebraically eg: v=u+a*t -> a=(v-u)/t

    I would like to make a program which solves for an unknown in an equation, which seems easy to do on paper, but I have no idea how to make the computer do it.
    Here's an example: I start with a...
  2. Re: [RESOLVED] Can you use sendmessage to change datepicker value in external app?

    I've just realised that I got type mismatch because i used both " and # now it's ok. Although it assumes the date is in American format when I put it this way:
    SetDTPTime chld, #9/7/2013#i.e. in...
  3. Replies
    9
    Views
    1,301

    Re: Disable printing of another/all workbooks

    I'm don't get it. Could you upload a workbook which you have already set up this way?
  4. Replies
    9
    Views
    1,301

    Disable printing of another/all workbooks

    I can use this code to disable printing on a macro eanabled workbook:


    Private Sub workbook_BeforePrint(Cancel As Boolean)
    Cancel = True
    MsgBox "You cannot print this workbook"
    End Sub
    ...
  5. Re: [RESOLVED] Can you use sendmessage to change datepicker value in external app?

    I got type mismatch after putting "#".

    I may have done it incorrectly, but changing LT to ST didn't work for me. In excel 0 = 00/01/1900, and I know in some systems 0 = 30/12/1899. Assuming mine...
  6. Re: Can you use sendmessage to change datepicker value in external app?

    I'm sorry I didn't read your post properly. When I looked at DTM_SETSYSTEMTIME I assumed it only changes the system time. Since then I tried and it worked, without the reliability issues associated...
  7. Re: Can you use sendmessage to change datepicker value in external app?

    Changing system time doesn't work this time as this program doesn't get it's date from windows. The handle is "ctrl1". This one didn't work:


    Call SendMessage(ctrl1, WM_SETTEXT, 0&, "01/01/2010")...
  8. [RESOLVED] Can you use sendmessage to change datepicker value in external app?

    I have an external app which is not a Microsoft product and I want to automate using it. I've already used sendmesage successfully to control various UI elements, like this one for pressing a button ...
  9. Re: simulate mouse click when the target window is in background

    You may be right about bringing it to the top. About not finding the handle I was not completely clear. Knowing the handle of the main window is enough for simulating mouse click with mouse_event (I...
  10. simulate mouse click when the target window is in background

    I've been doing a lot of automation lately. In some cases I can't avoid using simulated mouse clicks. Unfortunately at my workplace there are programs which randomly pop up to steal the focus and...
  11. Re: If a program was made in VB, is there an easier way of controlling it with macros

    Thanks for the info. I'll just continue with what I've been doing so far. I believe that being able to send controls to other applications is useful anyway.
  12. Replies
    84
    Views
    224,498

    Sticky: Re: Visual Basic API FAQs

    Select menubar item with sendmessage

    Assuming you have a "New text document.txt" open this program will choose the "File" -> "Save As" menu. Please note: Instead of giving the name of the menu you...
  13. [RESOLVED] If a program was made in VB, is there an easier way of controlling it with macros?

    I suspect that this program was made in VB because there are ThunderRT6 classnames in it. Eg.: instead of Class: Button, it has Class: ThunderRT6CommandButton. Once it has also returned an error...
  14. Replies
    84
    Views
    224,498

    Sticky: Re: Visual Basic API FAQs

    Thanks for mentioning that. I usually just search these declarations on the internet and I never really go through them. If the incorrect declaration ever caused a problem I'd never find it. I...
  15. Replies
    84
    Views
    224,498

    Sticky: Re: Visual Basic API FAQs

    Enumerate windows

    Only use it on an empty worksheet. It gives you classnames, windowtitles, subwindows and handles in a format where the hierarchy is clear. I know spy++ can do this and more, but...
  16. Replies
    84
    Views
    224,498

    Sticky: Re: Visual Basic API FAQs

    Write into notepad

    Note: in theory this works with other editable fields like textboxes for passwords.


    Option Explicit
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"...
  17. Replies
    84
    Views
    224,498

    Sticky: Re: Visual Basic API FAQs

    Close window


    Option Explicit
    Private Declare Function PostMessage Lib "user32" _
    Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long...
  18. Replies
    84
    Views
    224,498

    Sticky: Re: Visual Basic API FAQs

    Click a button



    Option Explicit
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Declare...
  19. Thread: Post Race!

    by tahi.laci
    Replies
    68,852
    Views
    17,960,714

    Re: Post Race!

    This is the first question for which I can give a satisfactory answer. Yeah!
  20. Re: How can I tell which version of vba I use?

    Thanks. After ticking "Trust access to the VBA project object model" in the macro settings of the trust center I learned what I wanted. (it was 7.00)
  21. [RESOLVED] How can I tell which version of vba I use?

    This should be easy. I use MS office 2010 and I didn't download any upgrade, but I just can't find it.
  22. Re: Event doesn't fire when filling external combobox with sendmessage, only text cha

    I used sendmessage to double-click on the combobox, which fires the Click event. I'm sure this is not the "official" solution, but it works and I believe it's reliable.



    Option Explicit...
  23. Re: Event doesn't fire when filling external combobox with sendmessage, only text cha

    On the cmb.text line I get the "Variable not defined." error. If I leave that part out the code does the same as it used to.
  24. Re: Event doesn't fire when filling external combobox with sendmessage, only text cha

    I changed the variable name from "combobox", and &O0 to 0&. The result is still the same. If I put .hwnd after the variable name in sendmessage I get "Invalid Qualifier" error.
  25. [RESOLVED] Event doesn't fire when filling external combobox with sendmessage

    REI need to use the "Save As" dialog box to save a file on the Desktop. (Windows XP) To do that I made this code to change value of the combobox on the top combobox to "desktop". When I run it, the...
Results 1 to 25 of 25



Click Here to Expand Forum to Full Width