Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Common Dialog control to MS Excel

Status
Not open for further replies.

3576

Programmer
Jan 28, 2005
32
US
I was wondering if anyone knows whether it is possible to add CommonDialog control to excel spreadsheet programatically?

Thanks,

TW
 
Programatically? hmmm, do you mean in a macro or are you meaning that you will write a VBexe file which would add this control to an Excel Spreadsheet? I wouldn't see why you couldn't use the following:

<code>
Dim cd As New CommonDialog
</code>

This creates a new object "cd" as a CommonDialog control so it is as if a person were to drag and draw a CommonDialog control onto the form. I hope this helps a bit...

LF

"As far as the laws of mathematics refer to reality, they are not certain; as far as they are certain, they do not refer to reality."--Albert Einstein
 
Could you provide me with a code sample please...

TW
 
Sample code for what? I provided the sample code in order to create the CommonDialog object. Now that you have that you can do anything that a regular CommonDialog control can do and probably more. Just type the following after you have put the line from my previous posting in your code module:

cd.

and you will see that all sorts of methods, events and the such pop up. Use your imagination and see what you can do with it.

try:

cd.ShowOpen

and then run the macro to see what happens. The code is there, you just have to think about it and work it out.

LF

"As far as the laws of mathematics refer to reality, they are not certain; as far as they are certain, they do not refer to reality."--Albert Einstein
 
I didn't realize that it was that simple. Thanks...

TW
 
LOL! I do that too often! glad I could help

"As far as the laws of mathematics refer to reality, they are not certain; as far as they are certain, they do not refer to reality."--Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top