Posted: 2/25/2008 7:51:20 AM EDT
|
OK, I have a macro embedding a Word Doc into Excel, and displaying it as an Icon. BUT... It opens Word when I insert it, and I cant figure out how to close the word window from VB. I need to close it so I can finish a loop and run another iteration of the step. Any ideas? |
Ok, here is the code.
This inserts a word document as an Icon, and then the last two lines are to resize the Icon to match the cells I have in the sheet. I can get the .doc inserted, but it will not continue to the resizing because a word doc comes up and I cant seem to close it. Edit--> Ok, I got it now. I took the "Activate" command off the OLEObject.Add command and replaced it with .Select and all runs fine now. I will not open the Word Doc, and will keep going through the loop. |