ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Save Issue (https://www.excelbanter.com/excel-programming/335254-excel-save-issue.html)

AlbertGe

Excel Save Issue
 
All,

I use ADO to modify data in Excel, when I open the excel file, the data in
is showed updated, but when I use another program to visit it, the data is
not updated.
When I open and then close the file manually, the excel prompt me to save.
if I choose save, the data got by another program is right, if not save, the
data is still keep the original value.

Can someone give me the suggestion on how to avoid this issue.
Some demo code will be highly appreciated,

thanks,

Albert



K Dales[_2_]

Excel Save Issue
 
My guess is that you set the query to update your data when you open the
file. That would explain the behavior you describe: the update only takes
place when Excel opens the file because the macro is an Excel feature. Any
other app that uses the file only reads the saved data. So once you save the
data it is there to be used by the other apps, but if it is "old" data that
is saved, that is what the other apps have to work with. But when you open
the file in Excel, you see the new data.

Don't know how to avoid this. It is a limitation to the approach you are
using; Excel is not really set up to give you a "live" link between an
external database and 3rd party apps; that is what ODBC is for - but the
other apps have to support import via ODBC for that to work.
--
- K Dales


"AlbertGe" wrote:

All,

I use ADO to modify data in Excel, when I open the excel file, the data in
is showed updated, but when I use another program to visit it, the data is
not updated.
When I open and then close the file manually, the excel prompt me to save.
if I choose save, the data got by another program is right, if not save, the
data is still keep the original value.

Can someone give me the suggestion on how to avoid this issue.
Some demo code will be highly appreciated,

thanks,

Albert




AlbertGe

Excel Save Issue
 
For my case, two application use the same approach to visit excel file, the
difference is one application write excel file then close, the other only do
read. two all use oledb.
I guess, may be I need to save it after change data use recordset, but I do
not know how to realize it in ADO.

Anyway, than Dales for your kind comments,
Albert

"K Dales" дÈëÓʼþ
...
My guess is that you set the query to update your data when you open the
file. That would explain the behavior you describe: the update only takes
place when Excel opens the file because the macro is an Excel feature.

Any
other app that uses the file only reads the saved data. So once you save

the
data it is there to be used by the other apps, but if it is "old" data

that
is saved, that is what the other apps have to work with. But when you

open
the file in Excel, you see the new data.

Don't know how to avoid this. It is a limitation to the approach you are
using; Excel is not really set up to give you a "live" link between an
external database and 3rd party apps; that is what ODBC is for - but the
other apps have to support import via ODBC for that to work.
--
- K Dales


"AlbertGe" wrote:

All,

I use ADO to modify data in Excel, when I open the excel file, the data

in
is showed updated, but when I use another program to visit it, the data

is
not updated.
When I open and then close the file manually, the excel prompt me to

save.
if I choose save, the data got by another program is right, if not save,

the
data is still keep the original value.

Can someone give me the suggestion on how to avoid this issue.
Some demo code will be highly appreciated,

thanks,

Albert







All times are GMT +1. The time now is 10:24 AM.

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