Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
599 views
in Technique[技术] by (71.8m points)

.net - Looking for alternatives to 32-bit only Microsoft Common Controls (ListView)

I have a legacy application developed in VBA/Excel which uses ListView controls. Unfortunately, it looks like these controls can't be used with 64-bit versions of Excel:

Native 64-bit processes in Office 2010 cannot load 32-bit binaries. This includes the common controls of MSComCtl [such as ListViews]. An alternative must be found for existing Microsoft Office VBA solutions that utilize these controls when the code is migrated to 64-bit Office 2010.

I need to migrate that legacy application to Excel 2010/13 x64. The process is mostly painless except for those ListView controls.

What are my main options to replace the ListView control and which would be the most effective (from a time&difficulty to implement perspective)?

Notes:

  • This issue has been raised on MS forums but no practical answer has been given.
  • adding .net tag as I suspect some solutions could come from there.

To make it clearer, here is a snapshot of the Excel user form. The bottom part is the list view (I have hidden confidential information), which has sortable column, allows the user to select multiple, non-consecutive, lines.

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

One thing that is theoretically possible would be to write your display code as a .Net assembly and access that via COM from your VBA code (see for example How can I make use of .NET objects from within Excel VBA? as a starting point for how to do this).

That way you can write .Net code for your controls. I haven't done that myself and am not sure how well it applies to your problem, but it looks like an option.

I just found a short tutorial for calling .Net from Excel.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...