G
GUNNAR BAARDSEN
Hi there.
I have made a template that contains a userform (MAIN) and some macros.
Info from this userform is saved to/loaded from this template.
A button on this userform executes some commands to open another document
(based on a different template).
But when I have opened this other document, I have noe edit/navigating
access to the document.
The document freezes, and is not editable until I have closed my MAIN
userform.
How can I fix this problem, so that I can have several documents open at the
same time?? This must surely be possible.
An other problem with this, is that after I have opened this other document
ONCE, and try to open it again from the userform, IT WILL NOT open.
It generates a run-time error '5151':
The document name or path is not valid.
Try one or more of the following:
* Check the path to make sure it was typed correctly.
* On the File menu, click Open. Search for the file using this dialog box.
The document I'm trying to open (again) IS at the same location AND have the
same filename (I've not altered the code between this two tryouts - of
course![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
And the strange part is if I close the macro, and closes the template (and
Word 2002), and then loads the template, runs the macro again, push the
button that opens my second document - it opens!!!!
But the document is still not editable - like before.
To open the second document (from the button on the userform), I'm using
this line of code:
Documents.Add Template:="Something.dot"
Do I have to write some command/line of code that puts the focus on the
newly opened document or what??
Hoping some of you can give me some answers here.
Gunnar
I have made a template that contains a userform (MAIN) and some macros.
Info from this userform is saved to/loaded from this template.
A button on this userform executes some commands to open another document
(based on a different template).
But when I have opened this other document, I have noe edit/navigating
access to the document.
The document freezes, and is not editable until I have closed my MAIN
userform.
How can I fix this problem, so that I can have several documents open at the
same time?? This must surely be possible.
An other problem with this, is that after I have opened this other document
ONCE, and try to open it again from the userform, IT WILL NOT open.
It generates a run-time error '5151':
The document name or path is not valid.
Try one or more of the following:
* Check the path to make sure it was typed correctly.
* On the File menu, click Open. Search for the file using this dialog box.
The document I'm trying to open (again) IS at the same location AND have the
same filename (I've not altered the code between this two tryouts - of
course
And the strange part is if I close the macro, and closes the template (and
Word 2002), and then loads the template, runs the macro again, push the
button that opens my second document - it opens!!!!
But the document is still not editable - like before.
To open the second document (from the button on the userform), I'm using
this line of code:
Documents.Add Template:="Something.dot"
Do I have to write some command/line of code that puts the focus on the
newly opened document or what??
Hoping some of you can give me some answers here.
Gunnar