PDA

View Full Version : Any 64-bit Office users?



GTO
07-16-2014, 03:04 AM
Hi,

If you run Office in 64-bit, could you try opening/running the attached file at http://www.vbaexpress.com/forum/showthread.php?50053-vba-to-keep-the-focus-on-userform-last-used-textbox&p=312150&viewfull=1#post312150

See if it fouls for you like the OP reports.

Thank you so very much,

Mark

Aflatoon
07-17-2014, 01:48 AM
I'm not on 64bit currently but you have lTimerRet declared as Long but the function returns LongPtr.

GTO
07-17-2014, 03:03 AM
Thank you very much Aflatoon. Between other 'stuff' at work, I had spotted a thread where the same was noted by the OP after having changed the others to LongLong's. I also spotted Chip Pearson's example (#If VBA7 And WIN64, then LongLong's rather than LongPtr's), as well at least one where the fellow didn't change anything but lpTimerFunc to LongPtr (and the return).

Ouch, my eyes hurt!

Well, thank you again. I hope that fixes it (by what all I read tonight, I think it will) :-)

A two- second vent: [Bleep]ing computer! Just when one (albeit a 'sportsman' coder at best) thinks he is grasping the tiniest smidgeon.... "they" change stuff! Just lamenting and joking of course; I am sure 16 to 32 was just as graceful.

Thanks again,

Mark

Aflatoon
07-17-2014, 03:12 AM
If you can avoid the APIs, these changes are pretty transparent to VBA users typically. (apart from non-standard controls, of course)

GTO
07-17-2014, 03:47 AM
Agreed, but I am (as bits of time permit) trying to learn at least some of them. In this case, I at least could not think of a native way to setfocus to the last active control when the user flips to another app and back. I'm still not sure that watching for what window has the focus is the best way, but barring the 64-bit issues, it seems to work.

I would be the first to admit I am awfully lucky I am not trying to feed myself or others on coding (I would lose my belly awfully quickly); but I sure enjoy it when I can.