PC Review


Reply
Thread Tools Rate Thread

Copying worksheet from hidden instance of Excel

 
 
CG
Guest
Posts: n/a
 
      26th May 2010
Is it possible to open multiple worksheets in a hidden instance of
Excel and copy worksheets to a workbook in the original visible
instance? I want to open multiple files and would prefer to not see
all the files being opened in the windows task bar?

wb was opened in a hidden instance of excel. An error occurs at the
ws.copy line.

The error is: "Method 'Copy' of object '_Worksheet' failed"

Is there another option avoid seeing the files being opened in the
task bar?

application.screenupdating = false

Set wb1 = ActiveWorkbook

Set wb = xlApp.Workbooks.Open(fs.FoundFiles.Item(i))

For Each ws In wb.Worksheets
ws.Copy before:=wb1.Sheets(wb1.Sheets.Count)
Next ws

application.screenupdating = true

I am using XP sp3 with Excel 2003

I have it working by inserting worksheets and copying the usedrange.
I would prefer to copy the whole worksheet.
 
Reply With Quote
 
 
 
 
Homey
Guest
Posts: n/a
 
      27th May 2010
you cannot do this this way. you should open workbooks in first instance of
excel and copy sheets between workbooks. no reason to use a second instance
of excel even if this did work.


"CG" <(E-Mail Removed)> wrote in message
news:5a13bbd9-2e18-428b-a88b-(E-Mail Removed)...
| Is it possible to open multiple worksheets in a hidden instance of
| Excel and copy worksheets to a workbook in the original visible
| instance? I want to open multiple files and would prefer to not see
| all the files being opened in the windows task bar?
|
| wb was opened in a hidden instance of excel. An error occurs at the
| ws.copy line.
|
| The error is: "Method 'Copy' of object '_Worksheet' failed"
|
| Is there another option avoid seeing the files being opened in the
| task bar?
|
| application.screenupdating = false
|
| Set wb1 = ActiveWorkbook
|
| Set wb = xlApp.Workbooks.Open(fs.FoundFiles.Item(i))
|
| For Each ws In wb.Worksheets
| ws.Copy before:=wb1.Sheets(wb1.Sheets.Count)
| Next ws
|
| application.screenupdating = true
|
| I am using XP sp3 with Excel 2003
|
| I have it working by inserting worksheets and copying the usedrange.
| I would prefer to copy the whole worksheet.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to unhide hidden Excel Instance Missing Excel Debug Microsoft Excel Programming 2 13th May 2009 10:58 PM
Hidden Columns No Longer Hidden after Copying Worksheet? EV Nelson Microsoft Excel Misc 0 6th Dec 2006 04:25 PM
Excel Automation creates a hidden instance of Excel using the Append Method ScardyBob Microsoft Access VBA Modules 4 16th Aug 2006 02:16 PM
copying from another instance of excel Paul Microsoft Excel Programming 7 31st Dec 2004 12:01 AM
Omitting hidden columns when copying a range from a worksheet Andrew Microsoft Excel Discussion 1 6th Dec 2003 03:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:33 AM.