i want to activate sheet2 of current activated excel file. i.e. if current excel file say ABC is opened then i want that when i press hotkey f1 it should always activate sheet2 of ABC excel file...
how it is possible via com objects...
THANKS
How to activate specific excel sheet? Topic is solved
Re: How to activate specific excel sheet?
Code: Select all
xl:=ComObjActive("Excel.Application")
xl.Sheets("Sheet2").Select
Re: How to activate specific excel sheet?
What if the excel file is invisible, How do i select a specific sheet ?HotKeyIt wrote:You can simply create a macro in Excel and check the code that is run when you do thingsCode: Select all
xl:=ComObjActive("Excel.Application") xl.Sheets("Sheet2").Select
- flyingDman
- Posts: 2817
- Joined: 29 Sep 2013, 19:01
Re: How to activate specific excel sheet?
You can use xl.sheets(2).select or xl.sheets(3).activate. In most cases they are equivalent but you can select multiple sheets and then activate one of them (but not more than 1). You should be able to use select and activate when the Excel is not made visible.
14.3 & 1.3.7
Who is online
Users browsing this forum: Araphen, DataLife, ShatterCoder and 271 guests