View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default 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