In Macro
Sub StartRipper()
Dim b as boolean
Dim Ripperoutputpath as string
Dim Worksheetname as string
Dim RipperExtractionModule as string
Dim c as string
'These two lines lookup the parameters from a worksheet in the current workbook. These values
'are being returned correctly but for the sake of this demo I am hardcoding them below
'RipperExtractionParameters = GetRipperParameters("RipperExtractionParameters")
'RipperExtractionModule = GetRipperParameters("RipperExtractionModule")
Ripperoutputpath = "c:\tmp\AmazonUKOutput1.xls"
Worksheetname = "UK"
RipperExtractionModule = "ExtractAmazonUKFormat" 'Excuse the variable name containing 'module'. It is actually the function name that is being called.
RipperExtractionParameters = Ripperoutputpath & "," & Worksheetname
'This line is hardcoded and works. It allows me to step through the code like normal.
c = ExtractAmazonUKFormat(RipperOutputPath, WorksheetName)
'This is the one that I am trying to get working. Without the "C = " it runs the function correctly but wont let me step through it nor will it return a value
Run (RipperExtractionModule & "(" & RipperExtractionParameters & ")")
'I have also tried the following but with the same result.
'c = Evaluate (RipperExtractionModule & "(" & RipperExtractionParameters & ")")
End Sub
In Module
Public Function ExtractAmazonUKFormat(RipperOutputPath As String, WorksheetName As String) As string
Msgbox "RipperOutputPath" & vbcrlf & "Worksheetname"
ExtractAmazonUKFormat = "Done"
End Function
Bookmarks