First my apologies for raising yet another Excel/Fortran thread I know there are numerous historic ones already and I have spent some time going through them. Using the Autodice example in Composer XE 2013 and also taking some tips/code from the useful posts by Paul Curtis (thanks!) and others I have managed the implement a scheme to populate data from my Fortran application into a spreadsheet template which has a series of pre-prepared formats and charts. I have some useful utilities to insulate the hideousness of the interface from my working code and it seems to be working well so far.
I have a couple of frustrating problems. I noticed during testing that if the active sheet in excel is a chart then we fail as there are no cells to populate in the worksheet object! I can trap the error and tell the user to go away and sort it out but something more friendly must be possible I think. I can get the active worksheet object and interrogate the name of the sheet:
worksheet = $Workbook_GetActiveSheet(workbook, status) gbuf = $Application_GetName(worksheet, status) !get name of active sheet object - works!
It appears you can change the active sheet, however I can't see where you get a pointer to the sheet you actually want.
CALL $Worksheet_Activate($OBJECT, status) !we can activate a specific sheet if we know the pointer to it!
Also you can enquire the sheet Names in the workbook, the code below has OK status and returns a pointer value but I do not know what data type is being pointed at or how the retrieve said data:
ifred = $Workbook_GetNames(workbook, status)
1] Does anyone have any insight into this area to give some tips?
2] Also is there anywhere that gives some guidance on the use of the excel interface routines that are generated by the module wizard? There is some data on MSDN but it is quite hard to try to cross correlate and/or find information.
Thanks In Advance, Andrew