January 14, 200718 yr How do I open an excel workbook to a specific worksheet whose name matches the contents of a field in FM7? I have tried to use a hyperlink but can't get FM to pass worksheet i.e. c:/workbook.xls#sheetname I also tried using the Send Event script step but couldn't get it to pass the worksheet name either. How can this be done using VB Script or ANY other solution? Again, I need to pass the contents of a field in FM7 to some soft of external script that will select and display an Excel worksheet of the same name as the contents of the field. Thanks in advance! ~ Tyler
January 14, 200718 yr In it's simplest form it would look something like this: Set xl = CreateObject("Excel.Sheet") xl.Application.Workbooks.Open "newbook.xls" ActiveWorkbook.Worksheets("Sheet1").Activate set xl = nothing You'd probably want to beed it up with some error handling and messages for your users. Now the challenge is in executing this from FM. A VBscript is merely a text file on the hard disk saved witha ".vbs" extension. FM can execute that external file through the Send Event. Have a look in the examples/samples tutorial for some of the things I've posted there. It includes some working ways of - generating VBscript syntax dynamically (which is what you want to do since you want content of your FM file in your VBscript) - execute it You can also use a VBscript plugin for this.
Create an account or sign in to comment