- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Ive been looking on the whole forum; how to save data from a Fortran program to an Excel file.
And finally, I found a sample named AUTODICE that is in the CVF samples and I tried to export it to IVF.
But there are many errors building the solution, for example:
Linking...
Debug/Autodice.obj:warning : locally defined symbol __imp__EXCEL97A_mp_$CHART_AXES imported
Debug/Autodice.obj:warning : locally defined symbol __imp__EXCEL97A_mp_$CHART_CHARTWIZARD imported
Debug/Autodice.obj:warning : locally defined symbol __imp__EXCEL97A_mp_CHARTS_ADD imported
Debug/Autodice.obj:warning : locally defined symbol __imp__EXCEL97A_mp_WORKBOOKS_OPEN imported
Debug/Autodice.obj:warning : locally defined symbol __imp__EXCEL97A_mp_$APPLICATION_GETWORKBOOKS imported
Debug/Autodice.obj:warning : locally defined symbol __imp__EXCEL97A_mp_$APPLICATION_SETVISIBLE imported
Autodice.obj : warning LNK4217: locally defined symbol _EXCEL97A_mp_$CHART_AXES imported in function _MAIN__
Autodice.obj : warning LNK4217: locally defined symbol _EXCEL97A_mp_$CHART_CHARTWIZARD imported in function _MAIN__
Autodice.obj : warning LNK4217: locally defined symbol _EXCEL97A_mp_CHARTS_ADD imported in function _MAIN__
Autodice.obj : warning LNK4217: locally defined symbol _EXCEL97A_mp_WORKBOOKS_OPEN imported in function _MAIN__
Autodice.obj : warning LNK4217: locally defined symbol _EXCEL97A_mp_$APPLICATION_GETWORKBOOKS imported in function _MAIN__
Autodice.obj : warning LNK4217: locally defined symbol _EXCEL97A_mp_$APPLICATION_SETVISIBLE imported in function _MAIN__
Autodice.obj : error LNK2019: unresolved external symbol _SLEEPQQ@4 referenced in function _CHECK_STATUS
Debug/autodice.exe : fatal error LNK1120: 1 unresolved externals
I have read the document Porting Applications from Compaq Visual Fortran to Intel Visual Fortran Compilers and I just followed those steps.
Im a newbie in IVF and I dont know if I need to execute the Fortran Module Wizard again and replace EXCEL97A.f90.
Can somebody tell me what to do? or upload AUTODICE sample built on IVF?.
Thank you so much.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
USE IFPORT
then this error should go away. The rest of the messages are warnings you can ignore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks so much for your help, Steve.
That works so good on AUTODICE example, thanx. But now I'm using this example to create another program which save data on Excel.
It builds succesfully as you told me, but when it runs,it doesn't do many operations.
WhenI debug I get the following lines causing the problem:
Code:
CALL $Application_SetVisible(excelapp, .TRUE.) workbooks = $Application_GetWorkbooks(excelapp, $STATUS = status) workbook = Workbooks_Open(workbooks, "C:HISTO.XLS", $STATUS = status) worksheet = $Workbook_GetActiveSheet(workbook, status) range = $Worksheet_GetRange(worksheet, vBSTR1, vBSTR2, status) CALL Range_Select(range, status)
If I delete these lines the program works fine, although I can't export to excel.
When building I get the following warnings:
locally defined symbol __imp__EXCEL97A_mp_RANGE_SELECT imported
locally defined symbol __imp__EXCEL97A_mp_$WORKSHEET_GETRANGE imported
locally defined symbol __imp__EXCEL97A_mp_$WORKBOOK_GETACTIVESHEET imported
locally defined symbol __imp__EXCEL97A_mp_WORKBOOKS_OPEN imported
locally defined symbol __imp__EXCEL97A_mp_$APPLICATION_GETWORKBOOKS imported
locally defined symbol __imp__EXCEL97A_mp_$APPLICATION_SETVISIBLE imported
Do you have any idea how can I fix these warnings?
I think if therewere no warnings this would work.
Thanks again so much!.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're having a problem, it's unrelated to those warnings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Workbooks_Open $Application_GetWorkbooks $Workbook_GetActiveSheet
modify an array value when they execute, for example:USE DFLIB
USE DFWIN
USE DFCOM
USE DFCOMTY
USE DFAUTO
USE ADOBJECTS
USE EXCEL97A
...
C THIS IS MY ARRAY DIMENSION VEC(22) ... C OPEN A FILE OPEN (UNIT = 3, FILE = 'DATA.TXT', STATUS = 'OLD') ... C EXPORTING EXCEL CODE ! Get the WORKBOOKS object workbooks = $Application_GetWorkbooks(excelapp, $STATUS = status) CALL Check_Status(status, " Unable to get WORKBOOKS object") ! Open the specified spreadsheet file (note: specify the full file path) workbook = Workbooks_Open(workbooks, "C:E.XLS", $STATUS = status) CALL Check_Status(status, " Unable to get WORKBOOK object") ! Get the worksheet vInt%VT = VT_I4 vInt%VU%LONG_VAL = 1 worksheet = $Workbook_GetActiveSheet(workbook, status) CALL Check_Status(status, " Unable to get WORKSHEET object") ... C READ DATA FROM THE FILE READ (3,*) X ...
When the program arrives tothe line " READ (3,*) X" the values of VEC change from:
VEC(1)0.000000000000000E+000
VEC(2)0.000000000000000E+000
VEC(3)0.000000000000000E+000
VEC(4)0.000000000000000E+000
VEC(5)0.000000000000000E+000
VEC(6)0.000000000000000E+000
VEC(7)0.000000000000000E+000
VEC(8)0.000000000000000E+000
VEC(9)0.000000000000000E+000
VEC(10)0.000000000000000E+000
To:
VEC(1)2.766767616710981E-322
VEC(2)1.190981997784375E-316
VEC(3)1.698179314427550E-313
VEC(4)1.697596632821624E-313
VEC(5)9.284182976689338E-302
VEC(6)6.578186951992344E-313
VEC(7)9.281441685695655E-302
VEC(8)3.927450923397306E-307
VEC(9)2.313002578360705E-307
VEC(10)3.810214909260900E-307
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page