Hemendra Posted February 16, 2018 Share Posted February 16, 2018 HI, using SHELLEXECUTE function to open EXCEL file of particular location. I will have to wait data to dumped in particular opened sheet, then I need to run specific MACRO of that opened file. How can I run MACRO from our DAQ? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted February 16, 2018 Share Posted February 16, 2018 That I don't know. That would be on the Excel side. You may be able to use a command line flag to tell Excel to do something on load, but I am unsure as I don't really use Excel. Check it's manual. ShellExecute() in DAQFactory is the same as typing something in at the Command Prompt. Quote Link to comment Share on other sites More sharing options...
SteveMyres Posted February 17, 2018 Share Posted February 17, 2018 I not sure, either, but it's possible that's there's a magic name for a macro, like "autoexec" or something, whereby Excel knows to automatically run it when the document is opened. Quote Link to comment Share on other sites More sharing options...
Hemendra Posted February 19, 2018 Author Share Posted February 19, 2018 thank you GURU and STEVE Quote Link to comment Share on other sites More sharing options...
JatCosta Posted January 22, 2020 Share Posted January 22, 2020 add the macro to sub Workbook_Open() event and excel will execute your macro whenever the Workbook is opened by DaqFactory. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.