Excel Form Positioning Relative to Range

%3CLINGO-SUB%20id%3D%22lingo-sub-2174412%22%20slang%3D%22en-US%22%3EExcel%20Form%20Positioning%20Relative%20to%20Range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2174412%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EIn%20Bullen's%20book%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EProfessional%20Excel%20Development%3C%2FEM%3E%3CSPAN%3E%26nbsp%3Bin%20the%20section%20%E2%80%9CUserform%20Positioning%20and%20Sizing%E2%80%9D%2C%20he%20refers%20to%20a%20window%20class%20%E2%80%9CEXCELE%E2%80%9D%20used%20by%20Excel%20when%20working%20with%20a%20chart%20object.%20In%20the%20current%20version%20of%20Excel%20this%20window%20class%20does%20not%20appear%20to%20be%20used.%20Does%20anyone%20have%20an%20alternative%20to%20this%20technique%20of%20getting%20a%20range%E2%80%99s%20pixel%20coordinates%20relative%20to%20the%20Windows%20desktop%3F%20I%20have%20tried%20a%20few%20different%20objects%2C%20but%20none%20appear%20to%20have%20their%20own%20window%20object%20that%20can%20be%20found%20using%20the%20Windows%20SDK%20call%20FindWindowEx.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EI%20have%20tried%20Pearson%E2%80%99s%20form%20positioner%20and%20various%20other%20techniques%20I%20have%20found%20on%20the%20web%2C%20but%20they%20are%20all%20performing%20poorly%20in%20the%20current%20version%20of%20Excel.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EAnother%20idea%20is%20to%20use%20the%20XLDESK%20window%20which%20gets%20us%20past%20the%20window%20frame%2C%20ribbon%20and%20formula%20bar%20but%20that%20still%20involves%20monkeying%20with%20the%20sheet%20headers%2C%20panes%2C%20scrolling%2C%20and%20zoom%20level.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2174412%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Edeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

In Bullen's book Professional Excel Development in the section “Userform Positioning and Sizing”, he refers to a window class “EXCELE” used by Excel when working with a chart object. In the current version of Excel this window class does not appear to be used. Does anyone have an alternative to this technique of getting a range’s pixel coordinates relative to the Windows desktop? I have tried a few different objects, but none appear to have their own window object that can be found using the Windows SDK call FindWindowEx.

I have tried Pearson’s form positioner and various other techniques I have found on the web, but they are all performing poorly in the current version of Excel.

Another idea is to use the XLDESK window which gets us past the window frame, ribbon and formula bar but that still involves monkeying with the sheet headers, panes, scrolling, and zoom level.

0 Replies