I would not use Public variable.
Module1
Sub firstRun()
Application.ScreenUpdating = False
Run "Module2.importOrderSubs", "ReferenceClientWorkbook_Rowan.xlsm", _
"trading Spreadsheet_Rowan.xlsm", _
"M:\Hedge Fund Management\R files\Rowan's Model\Code\2013-12-02\"
End Sub
Module2
Private Sub importOrderSubs(referenceClkientWorkbook, _
tradingSpreadsheet, userLocation)
Workbooks(referenceClientWorkbook).Activate
Sheets("Pairs").Activate
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & userLocation & "Exports\orderSubs.txt", _
Destination:=Range("$A$11"))
.Name = "orderSubs_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 2
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub
Bookmarks