I'm having problems converting to a text file from Excel.
The below code worked in 2003, but now I have put it in 2007 with just a change in the Range to work with.
What I'm getting is a Text file with, for lack of a better term, hyroglifics (sp).
Not the numbers that I should get like I got in 2003.
Anybody have an idea?
Thanks
Harry
The below code worked in 2003, but now I have put it in 2007 with just a change in the Range to work with.
What I'm getting is a Text file with, for lack of a better term, hyroglifics (sp).
Not the numbers that I should get like I got in 2003.
Code:
Private Sub CommandButtonExportPAG_Click()
Application.ScreenUpdating = False
On Error GoTo errTrap
'//Hide the rows with 0 values
LastRow = Range("S65536").End(xlUp).Row
For r = LastRow To 263 Step -1
If (Range("S" & r).Value = 0) Then
Rows(r).Delete
End If
Next r
Application.Wait (Now + TimeValue("0:00:01"))
Range("K264", Range("S264").End(xlDown).Offset(0, -1)).Copy
Sheets.Add
ActiveSheet.Name = "TEMP"
Selection.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
Application.Range("A1").Select
Sheets("TEMP").Copy
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"E:\Documents and Settings\michele_p.NSP\Desktop\Job Setup.txt", FileFormat _
:=xlText, CreateBackup:=False
ActiveWindow.Close
ActiveWindow.SelectedSheets.Delete
Sheets("PAG").Range("K264", Range("S264").End(xlDown)).ClearContents
Range("A1").Select
Application.DisplayAlerts = True
Application.ScreenUpdating = True
SplashForm.Show
Exit Sub
errTrap:
Application.Dialogs(xlDialogSaveAs).Show ("Job Setup.txt")
ActiveWindow.Close
ActiveWindow.SelectedSheets.Delete
Sheets("PAG").Range("K264", Range("S264").End(xlDown)).ClearContents
Range("A1").Select
Application.DisplayAlerts = True
Application.ScreenUpdating = True
SplashForm.Show
End Sub
Anybody have an idea?
Thanks
Harry