Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Move Worksheet from one Workbool to another - fails on Excel 2007

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 befo=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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Move Worksheet from one Workbool to another - fails on Excel 2007

Could a moderator change the spelling in the thread title for Workbook?

"Mark Leonard" wrote:

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 befo=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!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Move Worksheet from one Workbool to another - fails on Excel 2007

Could a moderator change the spelling in the thread title for Workbook?

There is no moderator.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Mark Leonard" wrote in message
...
Could a moderator change the spelling in the thread title for Workbook?

"Mark Leonard" wrote:

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 befo=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!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
File Move-Drag and Drop Fails in Office 2007 Excel & Word Cole Excel Discussion (Misc queries) 0 March 19th 10 09:32 PM
Excel 2007 Move or Copy worksheet lionking Excel Worksheet Functions 2 November 12th 09 02:02 AM
how do I move a worksheet in Office 2007? ladydoglover Excel Discussion (Misc queries) 1 June 23rd 08 04:21 PM
Excel in Office 2007 fails to start ... Arif[_2_] Setting up and Configuration of Excel 1 June 17th 08 09:51 AM
Excel 2007 copy/move worksheet to another workbook Hoekie@work Excel Discussion (Misc queries) 0 June 21st 06 07:27 AM


All times are GMT +1. The time now is 03:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"