Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to save file without the save message?
Hi,
How to save file after change without the save message? I read man thead. But it do not work. Application.DisplayAlerts = False ThisWorkbook.Save ActiveWorkbook.Close This code does not save change! -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to save file without the save message?
Which are you trying to work with
Thisworkbook (the workbook with the code) or ActiveWorkbook Thisworkbook.Close SaveChanges:=True or ActiveWorkbook.Close SaveChanges:=True -- Regards, Tom Ogilvy "Together " wrote in message ... Hi, How to save file after change without the save message? I read many thead. But it do not work. Application.DisplayAlerts = False ThisWorkbook.Save ActiveWorkbook.Close This code does not save change! --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to save file without the save message?
Thank you, Sir
But it seems that it still can not work. The code: Application.DisplayAlerts = False ActiveWorkbook.Close SaveChanges:=True is the same as: ActiveWorkbook.Close SaveChanges:=True I use the VBA to analyze some data in workbook. After I finish it, hope the workbook can close automaticly with saving the change I made -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to save file without the save message?
here is the code:
Sub module3() Dim m As Integer Dim value As Integer Dim i, j, n As Integer Dim k As String Dim DaSourceFile As String, DaSourceAfter As String DaSourceAfter = "D:\Excel\" 'fix the folder direction DaSourceFile = Dir(DaSourceAfter & "*.xls") 'get the file *.xls 'loop through all of the txt files Do While DaSourceFile < "" Workbooks.Open Filename:=DaSourceAfter & DaSourceFile 'open one file Worksheets.Add Worksheets(1).Activate j = 2 'the fisrt row is used for note Worksheets(1).Cells(1, 1) = "lane1" Worksheets(1).Cells(1, 2) = "lane2" Worksheets(1).Cells(1, 3) = "lane3" Worksheets(1).Cells(1, 4) = "total volume" n = 1 'fix the first column as the volume of different lane For i = 1 To 700 'row search the volume Worksheets(2).Activate ' this sheet contains the data from cosim If Worksheets(2).Cells(i, 9) = "RADAR" Then 'Search condition for row value = Worksheets(2).Cells(i, 10).value ' the data needed in th project Worksheets(1).Activate ' this sheet contains the data I need Worksheets(1).Cells(j, n) = value 'give the value of sheet1 to sheet2 n = n + 1 If n = 4 Then 'sum the volume in different lanes Worksheets(1).Cells(j, 4) = Worksheets(1).Cells(j, 1) + _ Worksheets(1).Cells(j, 2) + Worksheets(1).Cells(j, 3) j = j + 1 n = 1 End If Worksheets(2).Activate End If Next i 'Application.DisplayAlerts = False ActiveWorkbook.Save ActiveWorkbook.Close SaveChanges:=True DaSourceFile = Dir() Loop End Su -- Message posted from http://www.ExcelForum.com |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to save file without the save message?
I got it. Thank all of you.
The problem is that the format of my excel file is not xlwindownormal -- Message posted from http://www.ExcelForum.com |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to save file without the save message?
That isn't a valid format anyway. the format is
xlWorkbookNormal or xlNormal ? xlWorkbookNormal -4143 ? xlNormal -4143 ? xlWindowNormal the last produced nothing. -- Regards, Tom Ogilvy "Together " wrote in message ... I got it. Thank all of you. The problem is that the format of my excel file is not xlwindownormal. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
doing save as and get message that it cant find file | Excel Discussion (Misc queries) | |||
Error Message - File will NOT save | Excel Discussion (Misc queries) | |||
Macro to Save without the Save Message | Excel Discussion (Misc queries) | |||
Getting message can't save all data in excel xls file | Excel Discussion (Misc queries) | |||
When I save a file I consistently get a message about saving a co. | Excel Discussion (Misc queries) |