Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impact360 Report Viewer and VBA

Status
Not open for further replies.

robcarr

Programmer
May 15, 2002
633
GB
Hi,

I am using the coding below to save a report that is generated through impact 360 and is displayed using an excel internet explorer screen.

Code:
With ActiveWindow
Dim ddate As Date

If Range("a2").Value = "Planned Activity Cost (Unburdened) " Then
Range("b6").NumberFormat = "General"
Range("b6").Formula = "=if(iserror(LEFT(TRIM(RIGHT(TRIM(a6),LEN(TRIM(a6))-FIND("": "",TRIM(a6)))),FIND("" "",TRIM(RIGHT(TRIM(a6),LEN(TRIM(a6))-FIND("": "",TRIM(a6)))))-1)),""Error"",LEFT(TRIM(RIGHT(TRIM(a6),LEN(TRIM(a6))-FIND("": "",TRIM(a6)))),FIND("" "",TRIM(RIGHT(TRIM(a6),LEN(TRIM(a6))-FIND("": "",TRIM(a6)))))-1))"
If Range("b6").Value = "Error" Then
ddate = Range("b65536").End(xlUp).Value - 1
Else
ddate = Range("b6").Value
End If
    ActiveWorkbook.SaveAs FileName:= _
        "U:\Private\Temp\Impact 360 Exports\" & Format(ddate, "dd.mm.yy") & ".xls", FileFormat:=xlNormal, _
        Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
        CreateBackup:=False
'adherence report save coding
Else
 ddate = Range("c6").Value
 ActiveWorkbook.SaveAs FileName:= _
        "U:\Private\Temp\Impact 360 Exports\adh " & Format(ddate, "dd.mm.yy") & ".xls", FileFormat:=xlNormal, _
        Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
        CreateBackup:=False



 End If
.Close
End With
Application.Quit

[\code]

the save part of the coding works fine, however I can not get the window to close.

Any suggestions help on this would be most helpful.

I need to get the coding to close the window, and suggest any better way to do it.

the coding is activated when i choose the macro name from my right click menu.

Rob.

[COLOR=red][b][i][u]Hope this is of use, Rob.[/u][/i][/b][/color][yoda]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top