![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hi,
I am trying to import an excel sheet into an excel file. It works, however, cells that are more than 255 chars are cutting off...here is the code I am using...Please help!!! Is there an alternative? '*********************IMPORT EXCEL FILE********************* Dim Count As Integer Dim Response As Variant '***************New Code TO Extract********************** Dim xlBook As Excel.Workbook Dim xlSheet As Excel.Worksheet Dim CurrentWB As Excel.Workbook Dim FileName As Variant FileName = Application.GetOpenFilename _ (filefilter:="Excel Workbook(*.xls),*.txt,All Files(*.*),*.*") If FileName = False Then MsgBox "You did not select a file." Sheets("Setup").Select Exit Sub End If Application.ScreenUpdating = False Sheets("RawData").Select Cells.Select Selection.ClearContents Set CurrentWB = ThisWorkbook Set xlBook = Workbooks.Open(FileName, False, True) Set xlSheet = xlBook.Worksheets(1) xlSheet.Copy after:=CurrentWB.Sheets(CurrentWB.Sheets.Count) xlBook.Close savechanges:=False 'Application.ScreenUpdating = True CurrentWB.Sheets(CurrentWB.Sheets.Count).Select Cells.Select Application.CutCopyMode = False Selection.Copy Sheets("RawData").Select Cells.Select ActiveSheet.Paste Columns("A:Z").EntireColumn.AutoFit Application.DisplayAlerts = False Worksheets(CurrentWB.Sheets.Count).Delete Application.DisplayAlerts = True Set xlSheet = Nothing Set xlBook = Nothing Set CurrentWB = Nothing '*********************IMPORT EXCEL FILE********************* |
#2
|
|||
|
|||
![]()
Am 13 Mar 2006 12:58:11 -0800 schrieb Mo:
I´d say: Read each source cell value and write it into the target cell´s value. AFAIK about 65,000 characters are possible then. But for a better answer it might be helpful to ask an expert in an Excel newsgroup. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- Hi, I am trying to import an excel sheet into an excel file. It works, however, cells that are more than 255 chars are cutting off...here is the code I am using...Please help!!! Is there an alternative? '*********************IMPORT EXCEL FILE********************* Dim Count As Integer Dim Response As Variant '***************New Code TO Extract********************** Dim xlBook As Excel.Workbook Dim xlSheet As Excel.Worksheet Dim CurrentWB As Excel.Workbook Dim FileName As Variant FileName = Application.GetOpenFilename _ (filefilter:="Excel Workbook(*.xls),*.txt,All Files(*.*),*.*") If FileName = False Then MsgBox "You did not select a file." Sheets("Setup").Select Exit Sub End If Application.ScreenUpdating = False Sheets("RawData").Select Cells.Select Selection.ClearContents Set CurrentWB = ThisWorkbook Set xlBook = Workbooks.Open(FileName, False, True) Set xlSheet = xlBook.Worksheets(1) xlSheet.Copy after:=CurrentWB.Sheets(CurrentWB.Sheets.Count) xlBook.Close savechanges:=False 'Application.ScreenUpdating = True CurrentWB.Sheets(CurrentWB.Sheets.Count).Select Cells.Select Application.CutCopyMode = False Selection.Copy Sheets("RawData").Select Cells.Select ActiveSheet.Paste Columns("A:Z").EntireColumn.AutoFit Application.DisplayAlerts = False Worksheets(CurrentWB.Sheets.Count).Delete Application.DisplayAlerts = True Set xlSheet = Nothing Set xlBook = Nothing Set CurrentWB = Nothing '*********************IMPORT EXCEL FILE********************* |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I export more than 255 characters in notes? | ciareta | Outlook - Using Contacts | 1 | March 6th 06 11:30 PM |
Having trouble with Certificates | PA Bear | Outlook Express | 12 | February 20th 06 02:55 PM |
trouble importing pst files from 2000 to 2003 | unc6362 | Outlook - Using Contacts | 2 | January 26th 06 03:31 AM |
Make text in folders section bigger. | don | Outlook Express | 3 | January 25th 06 08:01 PM |
outlook calendar view - change colour of cells older than now | MarkB | Outlook - Calandaring | 1 | January 18th 06 01:39 PM |