Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28455 Discussions

How to activate a inactive worksheet in Excel using the Intel Visual FORTRAN.

hhadavi
Beginner
588 Views

Hi everybody,

I am still struggling to plot a group of 3D surface plots in a single excel workbook from inside the Intel Visual FORTRAN (IVF). I have made a relatively good progress, of course, working around the problems with the Intel Visual FORTRAN communicating with EXCEL.

My problem at this stage is that I have imported my data to the Excel active worksheet and need to activate another worksheet. I specifically beed to activate the second worksheet and put data in that one and then activate the third worksheet and put data in it and continue to the last worksheet. I tried all routines that IVF provided that I think would help me to activate the next worksheet, but I was not successful and could find the correct one with correct subroutin or FUNCTION arguments.

I need to do that to move to the next steps. I greatly appreciate if anyone has any idea how to that or maybe have done that before who can share with me his/her ways of doing it.

Thanks

Hadi

0 Kudos
1 Reply
IanH
Honored Contributor II
588 Views
Why do you need to activate the worksheet (activate = make it the current worksheet in the workbook)? As a user it annoys me when applications arbitrarily decide to flip my worksheet pages back and forth.

My approach would be to get a COM handle to the worksheet using Workbook_GetSheets/Sheets_GetItem, then get a handle to the range using $Worksheet_GetRange, then Range_SetItem to my heart's content.

Admitedly I do all this stuff from a DLL that is running within the Excel process, so perhaps there's some issue with out-of-process calls that I've not hit.

Are you creating this workbook from scratch?

What approaches have you tried?
0 Kudos
Reply