Hi there,
I know I've seen articles on this and thought there was something in the kb, but all I found was re 1024+ chars printing. Anyways, I think the easy way to get past it would be to copy twice. Once for the sheet layout and such, then copy the used range.
See if this helps:
Option Explicit
'//*********Tested, just example****************************************//
Sub CopyAllChar()
Dim wks As Worksheet
Dim wbNew As Workbook
'// Guessing a bit, that you just want the one sheet in the new wb...//
'// Set a reference to a new, one-sheet wb. //
Set wbNew = Workbooks.Add(xlWBATWorksheet)
'// Change name to source sheet //
With ThisWorkbook.Worksheets("Sheet1")
.Copy Before:=wbNew.Worksheets(1)
'// Delete the second (blank) sheet in the new wb. //
Application.DisplayAlerts = False
wbNew.Worksheets(2).Delete
Application.DisplayAlerts = True
'// The first .Copy copied the sheet in its entirety, cell widths, //
'// borders, layout, so on... But... dropped chars over 255. //
'// Go back and copy the cells, from A1 to the end of the used range, //
'// with the destination of A1 on the new wb's sheet. //
'// This way we don't lose chars and nothing "moves" should the //
'// usedrange start down/over a ways from A1. //
Range(.Range("A1"), .UsedRange.SpecialCells(xlCellTypeLastCell)).Copy _
wbNew.Worksheets(1).Range("A1")
End With
'// You already set a reference to the newly created wb. Ditch using //
'// active workbook, activesheet, selecting and so on when you already //
'// have more assured references. //
wbNew.SaveAs "D:\2010_PC\Temp.xls"
wbNew.Close False
End Sub
'//****************NOT tested**********************************************//
Public Sub Export2()
' Creates the DM Report File and saves it in the Tracking folder
Dim wb As Workbook
Dim wb2 As Workbook
Dim ws As Worksheet
Dim MyDir As String
Dim MyFile As String
Dim DTAddress As String
Dim newFile As String, fName As String
Const FLDR_NAME As String = "C:\Data\Tracking\"
fName = Range("SaveName").Value
newFile = fName
With Application
'.DisplayAlerts = False
.ScreenUpdating = False
End With
Set wb = ThisWorkbook
Set ws = Sheets("DM Report")
'// You can skip selecting here, you have a referene from above. //
'Sheets("DM Report").Select
Set wb2 = Workbooks.Add
ws.Copy Before:=wb2.Sheets(1)
'// Just a suggestion: Only keep alerts killed as long as actually needed. //
'// Just a rookie coder opinion, but similar to glossing over errror //
'// checking when unnecessary, warnings before things go KABOOM are usually //
'// a good idea. //
Application.DisplayAlerts = False
'// Use the reference already set. //
wb.SaveAs FLDR_NAME & (fName) & ".xls"
Application.DisplayAlerts = True
wb.Close False
'// Probably not needed //
Sheets("DM Report").Select
Application.ScreenUpdating = True
End Sub
Hope that helps,
Mark