Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
ASCO IS Help
 
Posts: n/a
Default run-time error '91'-Close Button error

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

Sub CloseMacro()
If IntState = "ON" Then
CancelDone = False
If Application.ActiveWindow.WindowNumber = 1 Then
DocIsReadOnly = ActiveWorkbook.ReadOnly
StoredId = GetDocumentId()
If StoredId < "" Then 'End-Retrieve the open document
DocId = StoredId
DocWasSaved = ActiveWorkbook.Saved
If Not (DocWasSaved) Then
ret = GWGetDocInfo(DocId, GW_NAME, DocInfoStr, 255)
If ret < GW_OK Or DocInfoStr = "" Then
DocInfoStr = DocId
End If
MsgStr = ClosePromptStr + DocInfoStr + "'?"
Style = vbYesNoCancel + vbQuestion
ret = MsgBox(MsgStr, Style, "Microsoft Excel")
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 = "" 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 Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
MT4Now
 
Posts: n/a
Default run-time error '91'-Close Button error

I 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 " If Application.ActiveWindow.WindowNumber = 1 Then"
After closing debugger, Excel closes. Is there a fix for this?

--
MontanaLiving


"ASCO IS Help" wrote:

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

Sub CloseMacro()
If IntState = "ON" Then
CancelDone = False
If Application.ActiveWindow.WindowNumber = 1 Then
DocIsReadOnly = ActiveWorkbook.ReadOnly
StoredId = GetDocumentId()
If StoredId < "" Then 'End-Retrieve the open document
DocId = StoredId
DocWasSaved = ActiveWorkbook.Saved
If Not (DocWasSaved) Then
ret = GWGetDocInfo(DocId, GW_NAME, DocInfoStr, 255)
If ret < GW_OK Or DocInfoStr = "" Then
DocInfoStr = DocId
End If
MsgStr = ClosePromptStr + DocInfoStr + "'?"
Style = vbYesNoCancel + vbQuestion
ret = MsgBox(MsgStr, Style, "Microsoft Excel")
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 = "" 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 Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run time error 1004 cinvic Excel Discussion (Misc queries) 3 February 19th 06 12:27 AM
First Time Error Using VLOOKUP malycom Excel Discussion (Misc queries) 4 February 17th 06 05:03 PM
run time error 1004 for other user [email protected] Excel Discussion (Misc queries) 1 January 26th 06 09:42 AM
2003 - Close Button Unavailable Chrissy Excel Discussion (Misc queries) 3 June 16th 05 10:51 PM
Macro to simply bring up the Find dialogue box?? marika1981 Excel Discussion (Misc queries) 14 January 14th 05 10:47 PM


All times are GMT +1. The time now is 01:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"