View Single Post
  #9 (permalink)  
Old 01-20-04, 10:36
Craig Silberman Craig Silberman is offline
Registered User
 
Join Date: Jan 2004
Posts: 5
More information...

I am only opening one instance, and even tried closing the workbook before quitting. It didn't work either. Here is the code:


Dim oApp As Object

DoCmd.OutputTo acReport, "SOA1", "MicrosoftExcel(*.xls)", "C:\isaudits\SOA1.xls", False, ""

Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
'Only XL 97 supports UserControl Property
On Error Resume Next
oApp.UserControl = True

Workbooks.Open Filename:= _
"C:\SOA\SOA1.xls"
Windows("SOA1.xls").Activate
Columns("C:C").select
Selection.Insert Shift:=xlToRight
Range("C1").select
ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-2],"" / "",RC[-1])"
Range("C1").select
Selection.Copy
Selection.SpecialCells(xlCellTypeLastCell).select
Range("C1:C17").select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveSheet.Paste
Range("C2").select
Cells.Replace What:=" / ", Replacement:=" ", LookAt:=xlWhole, SearchOrder _
:=xlByRows, MatchCase:=True
Range("C2").select
ActiveWorkbook.SaveAs Filename:= _
"C:\SOA\SOA1_new.xls", FileFormat:= _
xlExcel5, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False

Windows("SOA1_new.xls").Activate
Workbooks.Open Filename:= _
"C:\SOA\Status_new.xls"
Range("A2").select
Windows("SOA1_new.xls").Activate
Range("C2:J17").select
Selection.Copy
Windows("Status_new.xls").Activate
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("A2").select
ActiveWorkbook.SaveAs Filename:= _
"C:\SOA\Status_new.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

'oApp.Application.Quit
'Application.Quit
'oApp.DoCmd.Quit acQuitSaveNone
'ActiveWorkbook****nAutoMacros Which:=xlAutoClose
oApp.Quit


Any help would be appreciated.

Craig Silberman
Reply With Quote