M
Mark Leonard
A macro I used on Excel 2003 has stopped working now I am on Excel 2007.
I open a text files as a workbook then copy that sheet (the only sheet) into
another workbook which has been opened from a template, this way I am
combining the raw data i need in a text file with the formatting/macros I
need in the template workbook.
Here is the code
Dim xl As Excel.Application
Dim wbkCode As Excel.Workbook
Dim wbkTemp As Excel.Workbook
Set wbkTemp = xl.Workbooks.Open(filename:=strTempFullPath)
Set wbkCode = xl.Workbooks.Open(filename:=strWorkBookName)
wbkTemp.Workheets(1).Move before:=wbkCode.Worksheets(1)
the third line gives no errors, but adds no work sheets to wbkCode.
I can't use a range copy and paste as the text file can be extremely large,
right up to the limits of Excel's capacity, so the worksheet has to be moved
as an object as above. Any help greatly appreciated!
I open a text files as a workbook then copy that sheet (the only sheet) into
another workbook which has been opened from a template, this way I am
combining the raw data i need in a text file with the formatting/macros I
need in the template workbook.
Here is the code
Dim xl As Excel.Application
Dim wbkCode As Excel.Workbook
Dim wbkTemp As Excel.Workbook
Set wbkTemp = xl.Workbooks.Open(filename:=strTempFullPath)
Set wbkCode = xl.Workbooks.Open(filename:=strWorkBookName)
wbkTemp.Workheets(1).Move before:=wbkCode.Worksheets(1)
the third line gives no errors, but adds no work sheets to wbkCode.
I can't use a range copy and paste as the text file can be extremely large,
right up to the limits of Excel's capacity, so the worksheet has to be moved
as an object as above. Any help greatly appreciated!