ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get a workbook to import data when openeing and export when closi. (https://www.excelbanter.com/excel-programming/318822-get-workbook-import-data-when-openeing-export-when-closi.html)

Chris

Get a workbook to import data when openeing and export when closi.
 
How can I get excell to import data from a closed workbook. Then when changes
have been made, export and save the data to the workbook the data came from,
overwriting what is contained in it.

No Name

Get a workbook to import data when openeing and export when closi.
 
why not just open the closed WB with code, make all the
changes with code the save and close the WB with code.

ChDir "S:\PUBLIC\Some"
Workbooks.Open Filename:="\\data\PUBLIC\youfile.xls"
put code to make changes goes here
ActiveWorkbook.Save
ActiveWorkbook.Close

-----Original Message-----
How can I get excell to import data from a closed

workbook. Then when changes
have been made, export and save the data to the workbook

the data came from,
overwriting what is contained in it.
.


Chris

Get a workbook to import data when openeing and export when closi.
 
I cant do that as the code that is in the current workbook is written in a
way that it has to be the only one open. Otherwise it falls over with Run
Time errors. If it where that easy I would not be bald from pulling my hair
out. :-)

" wrote:

why not just open the closed WB with code, make all the
changes with code the save and close the WB with code.

ChDir "S:\PUBLIC\Some"
Workbooks.Open Filename:="\\data\PUBLIC\youfile.xls"
put code to make changes goes here
ActiveWorkbook.Save
ActiveWorkbook.Close

-----Original Message-----
How can I get excell to import data from a closed

workbook. Then when changes
have been made, export and save the data to the workbook

the data came from,
overwriting what is contained in it.
.




All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com