|
-
Sep 9th, 2005, 07:08 AM
#1
Thread Starter
Junior Member
Re: [WORD] Problem to open document
hmm i see, it is possibble, i'm agree but my application works perfectly on my laptop? why not on my desktop computer???
i already have tried to see where it bugs and it is when the application try to open the document.
-
Sep 9th, 2005, 07:21 AM
#2
Re: [WORD] Problem to open document
For your programs EXIT button, substitute this code. It will unload everything that is open.
VB Code:
Private Sub Command1_Click()
Dim frm As Form
Dim obj As Object
For Each frm In Forms
If frm.Name <> Me.Name Then ' Unload this form LAST
For Each obj In frm
On Error Resume Next
Unload obj
Set obj = Nothing
Next
Unload frm
Set frm = Nothing
End If
Next
On Error Resume Next
For Each obj In frm
Unload obj
Set obj = Nothing
Next
Set frm = Nothing
Unload Me
End Sub
-
Sep 9th, 2005, 07:38 AM
#3
Re: [WORD] Problem to open document
I suspect you are using Getobject to open instances of word this would be the fundamental cause of your problem. if so use this:
Code:
on error resume next
getobject("Word.Application")
if Err then
creatobject("Word.Application")
end if
on error goto ..... 'to your normal error handler
instead, it
will prevent opening so many instances of word in the first place. leaving memory for other proccesses
 why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
for every question you ask provide an answer on another thread.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|