ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getprivateprofilestring Crashes in Vista SP1 (https://www.excelbanter.com/excel-programming/410065-getprivateprofilestring-crashes-vista-sp1.html)

John[_137_]

Getprivateprofilestring Crashes in Vista SP1
 
I have a macro which works fine on Excel 2003 abut now crashes in
Excel 2007 since I upgraded Vista to SP1. It calls
Getprivateprofilestring to read an ini file several times and will
work for a few then simply crashes Excel without giving any error. It
actually seem to return the value but crash on exiting the Function
which called it. Any help gratefully received!
John

RB Smissaert

Getprivateprofilestring Crashes in Vista SP1
 
Could you post the relevant code?

RBS


"John" wrote in message
...
I have a macro which works fine on Excel 2003 abut now crashes in
Excel 2007 since I upgraded Vista to SP1. It calls
Getprivateprofilestring to read an ini file several times and will
work for a few then simply crashes Excel without giving any error. It
actually seem to return the value but crash on exiting the Function
which called it. Any help gratefully received!
John



John[_137_]

Getprivateprofilestring Crashes in Vista SP1
 
On 27 Apr, 23:01, "RB Smissaert"
wrote:
Could you post the relevant code?

RBS

"John" wrote in message

...

I have a macro which works fine on Excel 2003 abut now crashes in
Excel 2007 since I upgraded Vista to SP1. It calls
Getprivateprofilestring to read an ini file several times and will
work for a few then simply crashes Excel without giving any error. It
actually seem to return the value but crash on exiting the Function
which called it. Any help gratefully received!
John


Hi Bart
I have found the solution. It is actually do with dimming variables
not Getprivateprofilestring. I had dimmed some as
Dim icnt1,icnt2,icnt3 as integer
and prior to SP1 this worked fine but now it crashes. It seems to take
anything which is not explicitly dimmed as a variant but instead of
giving a nice wrong datatype error it crashed out. So if I put
Dim icnt1 as integer
Dim icnt2 as integer
etc it works fine.
Just another annoyance in vista!
John

RB Smissaert

Getprivateprofilestring Crashes in Vista SP1
 
OK, well you learned something useful there as
that is how variables should be done in any case.

RBS


"John" wrote in message
...
On 27 Apr, 23:01, "RB Smissaert"
wrote:
Could you post the relevant code?

RBS

"John" wrote in message

...

I have a macro which works fine on Excel 2003 abut now crashes in
Excel 2007 since I upgraded Vista to SP1. It calls
Getprivateprofilestring to read an ini file several times and will
work for a few then simply crashes Excel without giving any error. It
actually seem to return the value but crash on exiting the Function
which called it. Any help gratefully received!
John


Hi Bart
I have found the solution. It is actually do with dimming variables
not Getprivateprofilestring. I had dimmed some as
Dim icnt1,icnt2,icnt3 as integer
and prior to SP1 this worked fine but now it crashes. It seems to take
anything which is not explicitly dimmed as a variant but instead of
giving a nice wrong datatype error it crashed out. So if I put
Dim icnt1 as integer
Dim icnt2 as integer
etc it works fine.
Just another annoyance in vista!
John




All times are GMT +1. The time now is 12:01 AM.

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