SendMessage in VBA

prajul89

Active Member
Joined
Jul 9, 2011
Messages
404
I have took some VBA Codes from the Internet.
Its very complicated for me to know what exactly it is.

It has this line in between:
Code:
SendMessage GetDesktopWindow, WM_SETREDRAW, ByVal 0, 0&

I don't know what this line exactly does, But this line hangs my whole computer. Then the only way out is restarting the computer.

The codes also have Application.EnableCancelKey statement but have studied what it does and don't think it is a problem.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
That code disables the screen redraw for your computer (hence it appears to hang). That's what you get for playing with API code you don't understand... ;)
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top