Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default copy worksheet without opening the workbook

Hi all,

I would like ask if there's a way to copy a worksheet from a workbook A into
workbook B, without actually opening workbook A?

Thanks,

Ben

--

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default copy worksheet without opening the workbook

you can do it using formula.
try following:

Sub GetData()
Dim mydata As String
'data location & range to copy
mydata = "='C:\[NewBook.xls]Sheet1'!$B$2:F12" '<< change as required

'link to worksheet
With Worksheets(1).Range("B2:F12") '<< change as required
.Formula = mydata

'convert formula to text
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Application.CutCopyMode = False
End Sub

--
jb


"Ben" wrote:

Hi all,

I would like ask if there's a way to copy a worksheet from a workbook A into
workbook B, without actually opening workbook A?

Thanks,

Ben

--

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default copy worksheet without opening the workbook

See this site:

http://www.rondebruin.nl/ado.htm

"Ben" wrote:

Hi all,

I would like ask if there's a way to copy a worksheet from a workbook A into
workbook B, without actually opening workbook A?

Thanks,

Ben

--

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
Worksheet activation on Opening Workbook Raj[_2_] Excel Programming 2 February 20th 08 11:25 PM
Can you copy a worksheet from a workbook wothout opening it? Damien McBain[_4_] Excel Programming 5 January 24th 08 09:25 AM
Is there away to keep Excel from opening a copy of an already opened workbook and the pages not be at 100% but Marc New Users to Excel 1 March 13th 06 01:51 PM
Copy to different workbook without opening it JNW Excel Programming 4 December 2nd 05 09:03 PM
Copy a worksheet without 'opening' workbook SteveS[_3_] Excel Programming 2 October 11th 04 06:02 PM


All times are GMT +1. The time now is 07:22 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"