Guest Robert Mclean Report post Posted 03/26/2004 04:12 AM Is it possible to execute an Excel macro? My DDE command is as follows: Topic: Excel|Sheet1 Item: <blank> "Execute Command" selected Command: [Run(FindPrefix$RV_LINEID)] I've also tried: Command: [Activate(FindPrefix$RV_LINEID)] Share this post Link to post
SupportTeam Report post Posted 03/26/2004 05:48 AM Not too sure how to invoke Excel macros via Excel's DDE interface - best to look into Excel manuals on this one... You may want to look into using the Run VB Script module to control Excel via it's COM interface. There are some examples in VG Help file: The VB Script below saves information to an Excel spreadsheet. Dim xlApp, xlBook, xlSht Dim filename, value1, value2, value3, value4 on error resume next filename = "c:\warehouse.xls" Set xlApp = CreateObject("Excel.Application") set xlBook = xlApp.WorkBooks.Open(filename) set xlSht = xlApp.activesheet xlApp.DisplayAlerts = False 'write data into the spreadsheet xlSht.Cells(2, 2) = "New Data" xlBook.Save xlBook.Close SaveChanges=True xlApp.Close xlApp.Quit 'always deallocate after use... set xlSht = Nothing Set xlBook = Nothing Set xlApp = Nothing Share this post Link to post