Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default It works on 2000, but not on XP

Hi all:

I'm in trouble finding why the following code works on 2000, but does
not work on XP:

---------------------------------------------------------------
Public Sub DoFortran1(Optional FakeArg As Integer)
Dim Program, i
Dim TaskID As Long
Dim hProc As Long
Dim lExitCode As Long

' Executing External Fortran Procedure with detecting process status
ACCESS_TYPE = &H400
STILL_ACTIVE = &H103&

Program = ThisWorkbook.Path & "\Lab_Sim.exe"
'On Error Resume Next

TaskID = Shell(Program, 0) 'Launching Fortran program
hProc = OpenProcess(ACCESS_TYPE, False, TaskID) 'Get the process
handle

If Err < 0 Then
MsgBox "Cannot Start Fortran program " & Program, vbCritical,
"Error"
Exit Sub
End If

Do ' Looping to detect the program status to the end
Call GetExitCodeProcess(hProc, lExitCode)
DoEvents
UpdateProgress
Loop While lExitCode = STILL_ACTIVE

MsgBox "Fortran based calculation completed"

Unload Progress_FORTRAN

End Sub
----------------------------------------------------------------------

It is a VBA coding in Excel to execute a custom program in FORTRAN
called "Lab_Sim.exe". Anyone can tell me why this works on 2000, but
not on XP??

Thanks in advance.

TYP
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Works Spreadsheet 2000 v5.0 VLOOKUP John L. Excel Worksheet Functions 1 August 7th 05 08:05 PM
Save As... MS Works 2000 spreadsheet Thomas Excel Discussion (Misc queries) 2 May 7th 05 06:56 PM
Outlining works in XP not in 2000 Metallo[_4_] Excel Programming 3 July 14th 04 05:58 PM
Macro works in 2000 not XP for Progress Bar Far Excel Programming 0 May 19th 04 09:42 PM
VBA Code works in 2000 not 97 Michael Beckinsale Excel Programming 1 January 20th 04 05:38 PM


All times are GMT +1. The time now is 09:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"