Need Macro help...Data extraction from third party software

rohit999d

New Member
Joined
Jan 22, 2009
Messages
4
I am trying to extract results from a 3rd party software into excel using a macro. To avoid any technical details, the macro basically extracts labels of elements present in the the third party software in a column in excel which i managed.
For each label in the column, the macro should be able to extract results associated with it in a column in excel.

e.g. if the labels are extracted in Range(A1:A10),Iam expecting associated results for the 10 labels to start off from B1 and B2 onwards.

So after running the macro it should pick label 1 from A1 extract the results in column B and then move onto label 2 in A2 and further extract results in column C and so on and so forth till label 10.An example looks as follows:
Sub runpred()

Connect

Dim J As Integer, Numsteps As Integer, i As Integer, offset As Integer
Dim wl As Integer, wb As String, countwell As Integer, LEBELTEMP As String, Dim filetoopen As String


filetoopen = Range("h1")

DoSlowCmd "GAP.OPENFILE(""" + filetoopen + """)"

Numsteps = DoGAPFunc("GAP.PREDINIT()")


Range("J3") = Numsteps



For J = 1 To Numsteps

DoGAPFunc ("GAP.PREDDOSTEP(0)")




Next J

offset = 4
countwell = 0
wl = DoGet("GAP.MOD[0].WELL.COUNT")
Range("G3") = wl

For i = 0 To wl - 1
wb = "GAP.MOD[0].WELL[" + CStr(i) + "]"
Range("g" + CStr(i + offset)) = DoGet(wb + ".LABEL")

Next
For J = 0 To 50
LEBELTEMP = Range("g" + CStr(i + offset))

Cells(3 + countwell, 1) = DoGet(("GAP.MOD[{PROD}].WELL[{" & LEBELTEMP & "}].PREDRES.DATES[" & J & "].Datestr"))

countwell = countwell + 1

Next J


Disconnect

The first part runs a prediction from the third party software highlighted in blue.

Part highlighted in orange extracts all the labels in a column.

Part highlighted in red indicates the results to be extracted in subsequent columns based on the differeing labels which I am not able to obtain.

Portion highlighted in grey represents the third party string to be used in macro for extraction purpose. The name of the label should be represented by LEBELTEMP somehow where LEBELTEMP.

Hopefully the query should be clear in solving the logic which Iam looking forward to solve.

Appreciate your help i nthis matter.
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Watch MrExcel Video

Forum statistics

Threads
1,122,837
Messages
5,598,379
Members
414,234
Latest member
grlevesq

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top