ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reading and writing to ini files in Excel 2007 (https://www.excelbanter.com/excel-programming/422609-reading-writing-ini-files-excel-2007-a.html)

Rolf Gustafsson

Reading and writing to ini files in Excel 2007
 
I have thousands of Excel VBA rows created in Excel 2003 which now must be
migrated to Excel 2007. My computer has Office 2007 Professional and Vista
Business whilst my client is just about to migrate to Office 2007 but will
keep Windows XP.
My present API code for reading and writing to ini files just does not work
in Excel 2007. In fact, nothing happens.
I have spent a full day trying to find a solution on the web but without
success. My experience from Excel 2003 is that when writing to a non-existing
..ini file it will be created in the C:\Windows folder. Can anyone give useful
info about this?

It would be of great value to find a book/site or whatever info listing all
the objects/methods etc that has to be changed when migrating from Office
2003 to 2007. Is there such an info anywhere?

Bob Phillips[_3_]

Reading and writing to ini files in Excel 2007
 
What API method is that Rolf?

I use GetPrivateProfileString, WritePrivateProfileString, etc. They work
fine in 2007.

--
__________________________________
HTH

Bob

"Rolf Gustafsson" <Rolf wrote in
message ...
I have thousands of Excel VBA rows created in Excel 2003 which now must be
migrated to Excel 2007. My computer has Office 2007 Professional and Vista
Business whilst my client is just about to migrate to Office 2007 but will
keep Windows XP.
My present API code for reading and writing to ini files just does not
work
in Excel 2007. In fact, nothing happens.
I have spent a full day trying to find a solution on the web but without
success. My experience from Excel 2003 is that when writing to a
non-existing
.ini file it will be created in the C:\Windows folder. Can anyone give
useful
info about this?

It would be of great value to find a book/site or whatever info listing
all
the objects/methods etc that has to be changed when migrating from Office
2003 to 2007. Is there such an info anywhere?




Rolf Gustafsson[_2_]

Reading and writing to ini files in Excel 2007
 
Bob,
After some further testing I've found that the problem is neither my code
nor Excel 2007 but Vista! In Vista (which is new to me) there is a function
"User Account Control" whose default setting is "On". Obviously it considers
"C:\Windows" a protected area whereby the ini file is not created first time
you write to it. And there is no alert informing why this is omitted. But
once the ini file is there, Vista allows it to be edited also if "User
Account Control" is enabled.
When disabling the "User Account Control" my code works fine. If you are not
familiar with this Vista "security" nonsense perhaps we both learned from my
findings.

Thanks for responding anyhow! //Rolf G
--
RoGu


"Bob Phillips" wrote:

What API method is that Rolf?

I use GetPrivateProfileString, WritePrivateProfileString, etc. They work
fine in 2007.

--
__________________________________
HTH

Bob

"Rolf Gustafsson" <Rolf wrote in
message ...
I have thousands of Excel VBA rows created in Excel 2003 which now must be
migrated to Excel 2007. My computer has Office 2007 Professional and Vista
Business whilst my client is just about to migrate to Office 2007 but will
keep Windows XP.
My present API code for reading and writing to ini files just does not
work
in Excel 2007. In fact, nothing happens.
I have spent a full day trying to find a solution on the web but without
success. My experience from Excel 2003 is that when writing to a
non-existing
.ini file it will be created in the C:\Windows folder. Can anyone give
useful
info about this?

It would be of great value to find a book/site or whatever info listing
all
the objects/methods etc that has to be changed when migrating from Office
2003 to 2007. Is there such an info anywhere?





Bob Phillips[_3_]

Reading and writing to ini files in Excel 2007
 
Rolf,

I have avoided Vista like the plague, and have no intention of ever loading
it. No doubt I will encounter similar nannying functionality when I
implement W7.

--
__________________________________
HTH

Bob

"Rolf Gustafsson" wrote in message
...
Bob,
After some further testing I've found that the problem is neither my code
nor Excel 2007 but Vista! In Vista (which is new to me) there is a
function
"User Account Control" whose default setting is "On". Obviously it
considers
"C:\Windows" a protected area whereby the ini file is not created first
time
you write to it. And there is no alert informing why this is omitted. But
once the ini file is there, Vista allows it to be edited also if "User
Account Control" is enabled.
When disabling the "User Account Control" my code works fine. If you are
not
familiar with this Vista "security" nonsense perhaps we both learned from
my
findings.

Thanks for responding anyhow! //Rolf G
--
RoGu


"Bob Phillips" wrote:

What API method is that Rolf?

I use GetPrivateProfileString, WritePrivateProfileString, etc. They work
fine in 2007.

--
__________________________________
HTH

Bob

"Rolf Gustafsson" <Rolf wrote in
message ...
I have thousands of Excel VBA rows created in Excel 2003 which now must
be
migrated to Excel 2007. My computer has Office 2007 Professional and
Vista
Business whilst my client is just about to migrate to Office 2007 but
will
keep Windows XP.
My present API code for reading and writing to ini files just does not
work
in Excel 2007. In fact, nothing happens.
I have spent a full day trying to find a solution on the web but
without
success. My experience from Excel 2003 is that when writing to a
non-existing
.ini file it will be created in the C:\Windows folder. Can anyone give
useful
info about this?

It would be of great value to find a book/site or whatever info listing
all
the objects/methods etc that has to be changed when migrating from
Office
2003 to 2007. Is there such an info anywhere?








All times are GMT +1. The time now is 03:33 AM.

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