From: CG on 26 May 2010 12:52 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.
From: Homey on 27 May 2010 09:44 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" <cgjunk(a)gmail.com> wrote in message news:5a13bbd9-2e18-428b-a88b-43be4b76823e(a)f13g2000vbm.googlegroups.com... | 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.
|
Pages: 1 Prev: Delete Columns if sum is 0 Next: Icon in Notification zone |