close

We are currently receiving the DeBug information below from run-time error:

Sub CloseMacro()
If IntState = quot;ONquot; Then
CancelDone = False
If Application.ActiveWindow.WindowNumber = 1 Then
DocIsReadOnly = ActiveWorkbook.ReadOnly
StoredId = GetDocumentId()
If StoredId lt;gt; quot;quot; Then 'End-Retrieve the open document
DocId = StoredId
DocWasSaved = ActiveWorkbook.Saved
If Not (DocWasSaved) Then
ret = GWGetDocInfo(DocId, GW_NAME, DocInfoStr, 255)
If ret lt;gt; GW_OK Or DocInfoStr = quot;quot; Then
DocInfoStr = DocId
End If
MsgStr = ClosePromptStr DocInfoStr quot;'?quot;
Style = vbYesNoCancel vbQuestion
ret = MsgBox(MsgStr, Style, quot;Microsoft Excelquot;)
Select Case ret
Case vbYes
If DocIsReadOnly Then 'create a new profile for
the document
SaveNewDoc
Else
ActiveWorkbook.Save
End If
Case vbNo
ActiveWorkbook.Saved = True
Case vbCancel
CancelDone = True
GoTo NeverMind
End Select
End If
Application.ActiveWindow.Close
ret = GWCloseDoc(StoredId, 0, 0)
NeverMind:
Else 'If there is no DocId, check if the document has a name
If ActiveWorkbook.Path = quot;quot; Or DocIsReadOnly Then 'If the
doc is unnamed
SaveNewDoc
Else 'Just close the Named, Non-profiled document.
Application.ActiveWindow.Close
End If
End If
Else 'this is not the first window for the workbook
Application.ActiveWindow.Close
End If
Else ' Integrations are turned on
Application.ActiveWindow.Close
End If
End SubI am also getting this error on several PCs. Unloaded Office 2002 and loaded
Office 2003. When closing a spreadsheet get a MVB error highlighting the
line quot;gt; If Application.ActiveWindow.WindowNumber = 1 Thenquot;
After closing debugger, Excel closes. Is there a fix for this?

--
MontanaLivingquot;ASCO IS Helpquot; wrote:

gt; We are currently receiving the DeBug information below from run-time error:
gt;
gt; Sub CloseMacro()
gt; If IntState = quot;ONquot; Then
gt; CancelDone = False
gt; If Application.ActiveWindow.WindowNumber = 1 Then
gt; DocIsReadOnly = ActiveWorkbook.ReadOnly
gt; StoredId = GetDocumentId()
gt; If StoredId lt;gt; quot;quot; Then 'End-Retrieve the open document
gt; DocId = StoredId
gt; DocWasSaved = ActiveWorkbook.Saved
gt; If Not (DocWasSaved) Then
gt; ret = GWGetDocInfo(DocId, GW_NAME, DocInfoStr, 255)
gt; If ret lt;gt; GW_OK Or DocInfoStr = quot;quot; Then
gt; DocInfoStr = DocId
gt; End If
gt; MsgStr = ClosePromptStr DocInfoStr quot;'?quot;
gt; Style = vbYesNoCancel vbQuestion
gt; ret = MsgBox(MsgStr, Style, quot;Microsoft Excelquot;)
gt; Select Case ret
gt; Case vbYes
gt; If DocIsReadOnly Then 'create a new profile for
gt; the document
gt; SaveNewDoc
gt; Else
gt; ActiveWorkbook.Save
gt; End If
gt; Case vbNo
gt; ActiveWorkbook.Saved = True
gt; Case vbCancel
gt; CancelDone = True
gt; GoTo NeverMind
gt; End Select
gt; End If
gt; Application.ActiveWindow.Close
gt; ret = GWCloseDoc(StoredId, 0, 0)
gt; NeverMind:
gt; Else 'If there is no DocId, check if the document has a name
gt; If ActiveWorkbook.Path = quot;quot; Or DocIsReadOnly Then 'If the
gt; doc is unnamed
gt; SaveNewDoc
gt; Else 'Just close the Named, Non-profiled document.
gt; Application.ActiveWindow.Close
gt; End If
gt; End If
gt; Else 'this is not the first window for the workbook
gt; Application.ActiveWindow.Close
gt; End If
gt; Else ' Integrations are turned on
gt; Application.ActiveWindow.Close
gt; End If
gt; End Sub
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()