B
Brandon
I have some VBA written that opens a word document and closes the spreadsheet. It seems to work fine, but when I reopen the spreadsheet the page does not display (it is transparent, other than the boarder). I am able to close the Excel window. I look into the task list and there is an EXCEL process still running. I kill that and then the spreadsheet is able to open again.
Below is the language that I am using on a Click event:
//CODE
Private Sub openMerge_Click()
Dim x As Object, y As Object, z As String
On Error Resume Next
Set x = GetObject(, "Word.Application")
If Err.Number = 429 Then
Set x = CreateObject("Word.Application")
End If
z = "F:\FIS\TRAVEL\Excel Driven Travel Form\Local Travel.doc"
x.Visible = True
x.Activate
Set y = x.Documents(z)
If y Is Nothing Then
Set y = x.Documents.Open(z)
End If
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True
Application.Quit
On Error GoTo 0
End Sub
//END CODE
Any help would be greatly appreciated.
-Brandon
Below is the language that I am using on a Click event:
//CODE
Private Sub openMerge_Click()
Dim x As Object, y As Object, z As String
On Error Resume Next
Set x = GetObject(, "Word.Application")
If Err.Number = 429 Then
Set x = CreateObject("Word.Application")
End If
z = "F:\FIS\TRAVEL\Excel Driven Travel Form\Local Travel.doc"
x.Visible = True
x.Activate
Set y = x.Documents(z)
If y Is Nothing Then
Set y = x.Documents.Open(z)
End If
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True
Application.Quit
On Error GoTo 0
End Sub
//END CODE
Any help would be greatly appreciated.
-Brandon