Hi,
I have a problem with my VB code, which is shown as follows:
__________________________________________
Private Sub This_WorkbookOpen()
'
' Macro1 Macro
' Macro recorded 13/02/2005 by Jonathon White
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\phpdev\www\website\database\shareasale2.csv", Destination:=Range( _
"A1"))
.Name = "shareasale2"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileOtherDelimiter = "|"
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.Refresh BackgroundQuery:=False
End With
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Columns("B:B").Select
Selection.Delete Shift:=xlToLeft
Columns("B:C").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
ActiveWindow.SmallScroll ToRight:=3
Columns("E:E").Select
ActiveWindow.SmallScroll ToRight:=1
Selection.Delete Shift:=xlToLeft
Columns("F:F").Select
Selection.Delete Shift:=xlToLeft
Columns("H:H").Select
Selection.Cut
ActiveWindow.SmallScroll ToRight:=-2
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
ActiveWindow.SmallScroll ToRight:=1
Columns("I:S").Select
Selection.Delete Shift:=xlToLeft
ActiveWindow.SmallScroll ToRight:=-1
Range("I2").Select
ActiveCell.FormulaR1C1 = "=RC[-2]&"" ""&RC[-1]"
Range("I2").Select
Selection.AutoFill Destination:=Range("I2:I47684"), Type:=xlFillDefault
Range("I2:I47684").Select
ActiveWindow.ScrollRow = 1
ActiveWindow.SmallScroll ToRight:=1
Columns("I:I").Select
Selection.Copy
Columns("M:M").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Columns("G:L").Select
Range("L1").Activate
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
ActiveWindow.SmallScroll ToRight:=-1
Columns("G:G").Select
Selection.Cut
Columns("F:F").Select
Selection.Insert Shift:=xlToRight
ActiveWindow.SmallScroll ToRight:=-4
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
ChDir "C:\phpdev\www\website\database"
ActiveWorkbook.SaveAs Filename:= _
"C:\phpdev\www\website\database\shareasale7.txt", FileFormat:=xlText, _
CreateBackup:=False
ThisWorkbook.Close
Application.Close
End Sub
_____________________________________________
When ever the code is launch, I get a prompt at the end saying "do you want to save the changes made to 'shareasale.xls'?
How do I add that to my VB code above so that this prompt stops appearing?
I hope that someone can help me as I have been trying to work this out for a while now.
Thanks!
Bookmarks