Jump to content
Server Maintenance This Week. ×

Launch Excel to a certain worksheet


This topic is 6320 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 6320 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.