Link to home
Start Free TrialLog in
Avatar of malachyscullion
malachyscullion

asked on

TExcelApplication Server and switching between Excel Worksheets

HELP PLEASE

I require to programmatically switch between two differently named Excel worksheets in the same workbook. The excel file is opened from an already existing template so adding new workbooks is not an option. The template is required due to further analysis required on the output data.

Help please!!!

Malachy Scullion

ASKER CERTIFIED SOLUTION
Avatar of GloomyFriar
GloomyFriar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of malachyscullion
malachyscullion

ASKER

Thanks for the reply GloomyFriar,

Is there a way of passing the worksheet name as a parameter to a function that changes focus to the selected worksheet?????

ie) excelapplication1.worksheets.select('sample_worksheet_name')
ie) WorkSheet := WorkBk.WorkSheets.Get_Item(1) as _WorkSheet;


most of the solutions i have seen already involve adding your own blank worksheets. this is not valid solution in my case!

thanks

Malachy
Figured out how to do it.......

    WS := ExcelApplication1.Worksheets.Item['sample_worksheet_name'] as _Worksheet;
    WS.Activate(lcidExcel);

Thanks

Malachy