Excel database update

A

Antonio

Hi,
Have an excel template that should send data into a excel database.
When I run a marco, the database does not automatically update,
but if i do it step by step it updates.
("MatTer1.xls") when saved should update the database, by creating a new
record
in the code hereunder


ActiveWindow.WindowState = xlMinimized
Windows("CHAVES.xls").Activate
ActiveWindow.WindowState = xlMaximized
Selection.Copy
ActiveCell.Offset(2, 0).Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWindow.WindowState = xlMinimized
Windows("Terminações.xls").Activate
ActiveWindow.WindowState = xlMaximized
Sheets("Chaves").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("Pivots").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
Range("AJ10").Select
ActiveSheet.PivotTables("PivotTable4").PivotCache.Refresh
ActiveWindow.WindowState = xlMinimized
ActiveWindow.WindowState = xlMaximized
ActiveWorkbook.Save
ActiveWindow.WindowState = xlMinimized
Windows("CHAVES.xls").Activate
ActiveWindow.WindowState = xlMaximized
ActiveWorkbook.Save
ActiveWindow.WindowState = xlMinimized
Windows("MatTer.xls").Activate
ActiveWindow.WindowState = xlMaximized
ActiveWorkbook.Save
ActiveWindow.WindowState = xlMinimized
Windows("MatTer1.xls").Activate
ActiveWindow.WindowState = xlMaximized
ActiveWorkbook.Save
End Sub

can anyone help.

Tks In advance
Antonio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top