Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8064533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:23:47+00:00 2026-06-05T11:23:47+00:00

We have a macro that takes approximately 20 minutes to complete. We’ve got a

  • 0

We have a macro that takes approximately 20 minutes to complete.
We’ve got a c# winform that our user has access to – it contains a “Run Macro” button.
I’d like it so that the user can hit the button and then actually close the form and then in 20mins time see the output from the macro in a pre-defined directory.

Is it simply a case of creating a delegate and letting the delegate run the macro or is the above not a trivial matter?

Couple of ideas which might be viable:

  • Just hide the form after the user presses the button? Drawback is that the macro will still be tying up the user’s cpu within an instance of Excel?
  • Could the winForm on UserX’s pc somehow kick-off a program to run on our ‘Excel’ server? This sounds far fetched but maybe someone can help.
  • Similar to the above maybe on the Excel server I could create a small daemon console app that is scheduled to run every 2 seconds and check a table on a shared db to see if any macros need running. The user’s winform could update this control table and the daemon then goes to work.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:23:48+00:00Added an answer on June 5, 2026 at 11:23 am

    Yes it is simple.

    Use C# to launch a VBS File. The code will be something like

    System.Diagnostics.Process.Start(@"cscript //B //Nologo c:\MyScript.vbs");
    

    The above code will launch the VBScript with no prompts or errors and no shell logo.

    Next Step is to create a vbs file.

    Open Notepad and paste this code and save it as a MyScript.vbs file

    Dim xlApp, xlBook
    
    Set xlApp = CreateObject("Excel.Application")
    '~~> Change Path here
    Set xlBook = xlApp.Workbooks.Open("C:\Test.xls", 0, True)
    xlApp.Run "TestMacro"
    xlBook.Close
    xlApp.Quit
    
    Set xlBook = Nothing
    Set xlApp = Nothing
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a macro for excel which will pop up form that contains
I have a macro that takes a body: (defmacro blah [& body] (dostuffwithbody)) But
Say I have a macro, FOO(name), and some template class Bar<> that takes one
I have a velocity template (in a Confluence user macro) that looks like: ##
I have an Excel macro that takes an exceedingly long time. It seems to
I have a function-like macro that takes in an enum return code and a
I have a macro that iterates through some rows, to update the colouring of
I have a macro that passes the line number and file name to an
I am trying to have a macro that will do some formatting. I need
I have an umbraco macro that spits out the content of the page at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.