+ Reply to Thread
Results 1 to 4 of 4

API - Window on top of screen

  1. #1
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Karlstad, Sweden
    MS-Off Ver
    Excel 2016
    Posts
    232

    API - Window on top of screen

    Hi,

    I am using API (VBA Excel v2106) to activate a workbook. In my example below I try to activate "Book3.xlsx".

    Issue:
    - Function lhWndWorkbookWindow() returns 0 if the workbook isn't already active.

    NOTE!
    In reality I am trying to activate correct workbook in Excel from coding in VBA Microsoft Access. I just wanted to simplify my case for this forum. It's the same issue having the code directly in VBA Excel.

    Please Login or Register  to view this content.
    1. Reply to thread and inform if suggestion was helpful or not
    2. Click on the star (=Add Reputation) if you think someone helped you
    3. Mark [SOLVED] to this thread if solution was found. (On Menu "Thread Tools" > "Mark this thread as solved")

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: API - Window on top of screen

    Hi !

    That no needs API, why don't you use general VBA statements ?

    And just respecting model object, a good code does not need to activate anything !
    So the question is why do you need to activate a workbook ?
    Last edited by Marc L; 03-09-2017 at 06:59 AM.

  3. #3
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Karlstad, Sweden
    MS-Off Ver
    Excel 2016
    Posts
    232

    Re: API - Window on top of screen

    Hi,

    My issue is that all VBA code is in Microsoft Access (Including API). Then I invoke Excel to do my quite complicated reports. I have tried to use normal VBA code to show correct workbook in Excel. I gave up that by a lot of struggling. Then I involved API to get a more stable process. I hoped.

    If you have an example by doing that in VBA coding I'd appreciate that.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question


    It depends on your code and on all you did not explain ! As we are not mind readers …

    But the most important - whatever the process - is a good code very often does not need to activate anything (+99%) !

    So at least answer to this question : why do you need to activate a workbook ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Fill window screen
    By gocolonel77 in forum Excel General
    Replies: 2
    Last Post: 06-14-2015, 07:51 PM
  2. Full screen after window is minimized
    By lsteinbach in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-10-2013, 06:01 PM
  3. [SOLVED] disable window bar at top of screen in XL.
    By randall78 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-03-2012, 03:00 PM
  4. Full Screen in Smaller Window
    By Steve_Courts in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2011, 07:24 AM
  5. How do you block the copy window to right of screen
    By Todd F. in forum Excel General
    Replies: 2
    Last Post: 06-20-2006, 11:35 AM
  6. [SOLVED] Keeping VB Window on Screen
    By Paige in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-09-2005, 03:25 PM
  7. How can help window be moved on screen?
    By Jack in forum Excel General
    Replies: 1
    Last Post: 09-14-2005, 05:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1