I am trying to rewrite Excel 4.0 macro in VB.NET by calling the DLL from VBA code in excel. Looking for an example that can detect the range of cells selected by the user in order to perform some operation. The macro when executed present a dialog to let the user enter a value, which needs to be read by the system and a formula is built and filled in to the selected range of cells and executed.

Wait? What? https://en.wikipedia.org/wiki/Microsoft_Excel tells us this is Excel from 1992 or 30 years ago. I haven't seen that old a version of Excel in over 20 years and back then it didn't have the capability to call a DLL!

My advice is to forget this and write a new macro or if there's a typo in your post, correct that version.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.