Hello,

My Excel 97/VBA is executed online from a web server.
Two things are wrong with my Save Routine:

1. I do a Worksheet.Copy, Save it, Close it, and Retun to ThisWorkbook.
The problem is after this executes there is a big empty Window named "Microsoft Excel [Read-only]" which has the focus. My guess is that a new window is opened to create a new Workbook, then copies the Worksheet in. After Saving & Closing, only the empty window is left. If I close this empty window, my Application stops. My Application is running in a separate Window.

2. In the debugger, I see that "Application.ScreenUpdating = False" never gets set to False. Odd!

Here is the Save Routine:
VB Code:
  1. Private Sub cmdSave_Click()
  2.  Dim varFileName As Variant
  3.  
  4.  On Error GoTo 300
  5.  ChDir "C:\"
  6.  Do
  7.  varFileName = Application.GetSaveAsFilename("My Report", "Excel File(*.xls),*.xls", , "Save My Report")
  8.  Loop Until varFileName <> False
  9.  If (VarType(varFileName) = vbString) Then
  10.    Application.ScreenUpdating = False
  11.    objMyWS.Copy
  12.    ActiveWorkbook.SaveAs FileName:=varFileName, FileFormat:=xlWorkbookNormal
  13.    ActiveWorkbook.Close savechanges:=False
  14.    ThisWorkbook.Activate
  15.    Application.ScreenUpdating = True
  16.  End If
  17.    objMyWS.Activate
  18.    Exit Sub
  19. 300:
  20.    MsgBox Err.Number & " " & Err.Description
  21.    Resume Next
  22. End Sub
The question is, How do I remove the big empty Window and stop it from receiving focus? I would like that window to go away after the Workbook is closed. Why does "ScreenUpdating = False" fail? I need the WkSheet to refresh itself after line deletion (in another section of code).

It works fine offline, but once online - all rules change.

TIA,CJ