I would like to copy data from SAP into a table, I can copy them but the table moves to the right.
Sub StartExtract()
Application.WorksheetFunction.Transpose (X)
' Set the sid and client to connect to
W_System = "P10320"
' Run the GUI script
RunGUIScript
' End the GUI session
objSess.EndTransaction
' Switch to the worksheet where the data is loaded to
Application.WorksheetFunction.Transpose (BGSOCIAL)
Sheets("BGSOCIAL").Select
' Load the CSV file
OpenCSVFile
' Update the time and date on the control worksheet
Sheets("Extraction").Select
Cells(2, 2).Value = Now()
I think it's that part of the code that's a problem.
I would like to copy them inside the table
another part of the code
With ActiveSheet.QueryTables.Add(Connection:= _ "TEXT;" & fpath & "\" & ffilename, Destination:=Range("$A$1")) .Name = "text" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = 850 .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = True .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = False .TextFileOtherDelimiter = "|" .TextFileColumnDataTypes = Array(1) .TextFileTrailingMinusNumbers = True .Refresh BackgroundQuery:=False
End With