Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' ====================================================================
- ' IPM Openserver Prosper VBA - by Alfonso R. Reyes
- ' This subroutine opens a Prosper file and reads the commands on
- ' the table. It will return the values for each command.
- ' Additionally, returns the string name of few correlations
- ' =====================================================================
- Sub ReadFile()
- Dim i, j As Integer
- Connect
- For i = startRow To curRow - 1 '<-travel the rows
- Select Case MyApplication
- Case "Prosper"
- cmdOpen = "PROSPER.OPENFILE(""" + Cells(i, startCol) + """)"
- DoCmdNoStop "" + cmdOpen + ""
- For j = startCmdCol To endCmdCol '<-travel the columns
- Cells(i, j) = DoGetNoStop(Cells(IPMCommandsRow, j))
- Application.StatusBar = "File:" & Cells(i, startCol + 1) _
- & ", Row:" & i & "/" & (curRow - 1) _
- & " Col:" & j & "/" & endCmdCol & ", Cmd: " _
- & Cells(IPMCommandsRow, j) & ", Val: " _
- & Left(Cells(i, j), 25) 'show all this in status bar
- Next
- ' now convert the corrrelation number to its human value
- Cells(i, corr1NameCol) = PBCORR(Cells(i, corr1NumCol))
- Cells(i, corr2NameCol) = UOCORR(Cells(i, corr2NumCol))
- Cells(i, corr3NameCol) = IPRMETHOD(Cells(i, corr3NumCol))
- Cells(i, corr4NameCol) = VLPTUBING(Cells(i, corr4NumCol))
- Case "MBAL"
- DoCmdNoStop "MBAL.OPENFILE(""" + Cells(3, 6) + """)"
- Case "GAP"
- DoCmdNoStop "GAP.OPENFILE(""" + Cells(3, 6) + """)"
- End Select
- Next
- Disconnect
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment