Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exporting to a closed workbook
Hi Excel Gurus. I have bought so many VBA books but can't find the solution. What I need to do is export or import (whatever is best.) a range from an open work book to a closed workbook. Range a1 to I55 how can I do this? Please give us some ideas and I will see if I can get my money out of these books. thx -- Mikeice ------------------------------------------------------------------------ Mikeice's Profile: http://www.excelforum.com/member.php...o&userid=22467 View this thread: http://www.excelforum.com/showthread...hreadid=387059 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exporting to a closed workbook
You can Import from a closed wbk by using
DataGetExternalData I don't think you can Export from an open wbk to a "closed" wbk. but, you can do it with vba in the blink of an eye: Sub Export() Dim sFile as String Dim rSource as Range Dim rDest as Range Set rSource =ThisWorkbook.ActiveSheet.Range("A1:I55") sFile = ThisWorkbook.Path & "\MyFile.xls" 'Adjust as needed Workbooks.Open sFile Set rDest = ActiveWorkbook.Sheets(1).Range("A1") rSource.Copy rDest ActiveWorkbook.Close True End Sub You should also add error handling in case the file can't be found in the specified location. "Mikeice" wrote: Hi Excel Gurus. I have bought so many VBA books but can't find the solution. What I need to do is export or import (whatever is best.) a range from an open work book to a closed workbook. Range a1 to I55 how can I do this? Please give us some ideas and I will see if I can get my money out of these books. thx -- Mikeice ------------------------------------------------------------------------ Mikeice's Profile: http://www.excelforum.com/member.php...o&userid=22467 View this thread: http://www.excelforum.com/showthread...hreadid=387059 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exporting to a closed workbook
Mikeice,
ADO can work with closed workbooks, if it is straight data in a database-like structure. NickHK "Mikeice" wrote in message ... Hi Excel Gurus. I have bought so many VBA books but can't find the solution. What I need to do is export or import (whatever is best.) a range from an open work book to a closed workbook. Range a1 to I55 how can I do this? Please give us some ideas and I will see if I can get my money out of these books. thx -- Mikeice ------------------------------------------------------------------------ Mikeice's Profile: http://www.excelforum.com/member.php...o&userid=22467 View this thread: http://www.excelforum.com/showthread...hreadid=387059 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open a closed workbook with VBA | Excel Programming | |||
Value from a closed workbook | Excel Discussion (Misc queries) | |||
copy worksheet from closed workbook to active workbook using vba | Excel Worksheet Functions | |||
Getting value from closed workbook | Excel Programming | |||
find in closed workbook | Excel Programming |