+ Reply to Thread
Results 1 to 3 of 3

ActiveX control lose functionality when run as parameter to commandline excel.exe

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    toronto
    MS-Off Ver
    Excel 2003
    Posts
    58

    ActiveX control lose functionality when run as parameter to commandline excel.exe

    I have built a small script to demonstrate this. If this script is run by doubleclicking on desktop it will do its job. Press click me it will print a number next to it. Press clear me to clear the value. Very simple

    If you try to run this script by calling excel.exe in a cmd box as a file input to it - excel.exe testexample.xlsm. Both buttons immediately lose their clickability.

    It will be the same if you do RUN under START button in windows. The behaviour is the same as long as you call it using the script as an input.

    Pay attention to workbook_open I use an infinite loop with DoEvents in there to retain interaction with systems.

    Why are the activeX buttons losing their functionality?

    If we open visual basic editor and stop the loop, then reset and finally restart it. It will run normal again! The activeX will spring back alive.
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: ActiveX control lose functionality when run as parameter to commandline excel.exe

    Hello vientito,

    It is a security measure. Macros are disabled when running Excel from the command line. Once you have the workbook open and have enabled macros then the ActiveX controls will function normally.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-25-2013
    Location
    toronto
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: ActiveX control lose functionality when run as parameter to commandline excel.exe

    You say the macros are disabled from running in command line?

    by macros do you mean codes in my VBA xlsm file?

    I re-arrange things a bit, again the main codes are in workbook_open()

    Run this code using cmd line (i.e. excel.exe testagain.xlsm)... It will work. Just wait 5 secs the number will appear on the sheet.

    How do you explain that?

    At least it works from my office 2007 and vista station.
    Attached Files Attached Files

+ 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. Replies: 1
    Last Post: 08-12-2012, 04:02 PM
  2. [SOLVED] With autorecover on in Excel you lose your "undo" functionality.
    By AndyBofNY in forum Excel General
    Replies: 0
    Last Post: 04-28-2006, 05:55 AM
  3. [SOLVED] How to add an ActiveX control in Excel?
    By Dicaprio in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-03-2005, 11:35 PM
  4. [SOLVED] Where is the timer activex control in MS Excel VBA?
    By Andy_G in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-08-2005, 01:05 PM
  5. ActiveX control in Excel
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2005, 10:06 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