Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Msgbox preventing workbook save

This code is causing a workbook to throw the error "Document not
saved". Oddly enough it saves fine once I remove it. How can a message
box cause such a problem?

It gets stranger....If I create a new workbook and paste the code in
there it saves without a problem. The original workbook has 11 sheets
and a decent amount of data if that matters, (which I don't think it
does). Is this some kind of fluke bug or is there an explaination?
Excel 2k3, SP2


Public Sub Initialize()

check = MsgBox("Have you created/renamed all columns on all sheets as
follows?" & vbNewLine & _
"" & vbNewLine & _
"CUSIP - should contain all CUSIPs" & vbNewLine & _
"ISIN - should contain all ISINs" & vbNewLine & _
"BID - should contain all BID prices" & vbNewLine & _
"ASK - should contain all ASK/OFFER prices" & vbNewLine & _
"SYCODE - create, will initially be blank" & vbNewLine & _
"INVERT - create, will initially be blank" & vbNewLine & _
"MID - create, will initially be blank" & vbNewLine & _
"" & vbNewLine & _
"Please note that all columns must exist for the macro to work
properly." & vbNewLine & _
"", vbYesNo)

If check = 7 Then
Exit Sub
End If

'Var = Application.InputBox(Prompt:="This is a test", Type:=0)

'MsgBox (Var)


End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Msgbox preventing workbook save

The size of your file can make a difference in the amount of time it takes to
execute the save. And, depending on how many executions of other code there
is between the save command and the end sub command, it can possibly be
getting the end sub command before it executes the save and therefore, throws
the error.
But, if your message box is between the save command and the end sub
command, it should be able to save. Sometimes these things occur during a
session, and then they go away after everything is closed and reopened.
Maybe, gremlins.<g

"Kigol" wrote:

This code is causing a workbook to throw the error "Document not
saved". Oddly enough it saves fine once I remove it. How can a message
box cause such a problem?

It gets stranger....If I create a new workbook and paste the code in
there it saves without a problem. The original workbook has 11 sheets
and a decent amount of data if that matters, (which I don't think it
does). Is this some kind of fluke bug or is there an explaination?
Excel 2k3, SP2


Public Sub Initialize()

check = MsgBox("Have you created/renamed all columns on all sheets as
follows?" & vbNewLine & _
"" & vbNewLine & _
"CUSIP - should contain all CUSIPs" & vbNewLine & _
"ISIN - should contain all ISINs" & vbNewLine & _
"BID - should contain all BID prices" & vbNewLine & _
"ASK - should contain all ASK/OFFER prices" & vbNewLine & _
"SYCODE - create, will initially be blank" & vbNewLine & _
"INVERT - create, will initially be blank" & vbNewLine & _
"MID - create, will initially be blank" & vbNewLine & _
"" & vbNewLine & _
"Please note that all columns must exist for the macro to work
properly." & vbNewLine & _
"", vbYesNo)

If check = 7 Then
Exit Sub
End If

'Var = Application.InputBox(Prompt:="This is a test", Type:=0)

'MsgBox (Var)


End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Msgbox preventing workbook save

On Jun 28, 7:32 pm, JLGWhiz wrote:
The size of your file can make a difference in the amount of time it takes to
execute the save. And, depending on how many executions of other code there
is between the save command and the end sub command, it can possibly be
getting the end sub command before it executes the save and therefore, throws
the error.
But, if your message box is between the save command and the end sub
command, it should be able to save. Sometimes these things occur during a
session, and then they go away after everything is closed and reopened.
Maybe, gremlins.<g



"Kigol" wrote:
This code is causing a workbook to throw the error "Document not
saved". Oddly enough it saves fine once I remove it. How can a message
box cause such a problem?


It gets stranger....If I create a new workbook and paste the code in
there it saves without a problem. The original workbook has 11 sheets
and a decent amount of data if that matters, (which I don't think it
does). Is this some kind of fluke bug or is there an explaination?
Excel 2k3, SP2


Public Sub Initialize()


check = MsgBox("Have you created/renamed all columns on all sheets as
follows?" & vbNewLine & _
"" & vbNewLine & _
"CUSIP - should contain all CUSIPs" & vbNewLine & _
"ISIN - should contain all ISINs" & vbNewLine & _
"BID - should contain all BID prices" & vbNewLine & _
"ASK - should contain all ASK/OFFER prices" & vbNewLine & _
"SYCODE - create, will initially be blank" & vbNewLine & _
"INVERT - create, will initially be blank" & vbNewLine & _
"MID - create, will initially be blank" & vbNewLine & _
"" & vbNewLine & _
"Please note that all columns must exist for the macro to work
properly." & vbNewLine & _
"", vbYesNo)


If check = 7 Then
Exit Sub
End If


'Var = Application.InputBox(Prompt:="This is a test", Type:=0)


'MsgBox (Var)


End Sub- Hide quoted text -


- Show quoted text -


Yes yes I've considered gremlins and I swear if that regergitated
hairball Gizmo charged me and didn't finish the job I'm gonna shove my
foot up his fluffy white ass. I don't have any save commands in the
code so it shouldn't be affecting it. The only code I have literally
is what I posted, plus a few other lines which clear cells. The file
is 5.8mb, nothing large at all.

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
Preventing users from unsharing a workbook Cillian Excel Discussion (Misc queries) 0 December 1st 05 05:35 PM
preventing / converting 'illegal' characters in file-save text string Philo Hippo Excel Programming 0 October 12th 04 03:45 AM
preventing / converting 'illegal' characters in file-save text string Tim[_39_] Excel Programming 6 October 6th 04 04:13 PM
Preventing a workbook from being copied CiaraG[_4_] Excel Programming 1 March 4th 04 01:24 PM
Preventing opening workbook inside active workbook. Serge[_4_] Excel Programming 2 November 4th 03 07:51 PM


All times are GMT +1. The time now is 02:02 AM.

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

About Us

"It's about Microsoft Excel"