Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
doing save as and get message that it cant find file Mic Kenney - YTEX Excel Discussion (Misc queries) 0 March 16th 10 03:24 PM
Error Message - File will NOT save Jennifer Excel Discussion (Misc queries) 1 May 20th 08 12:45 PM
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
Getting message can't save all data in excel xls file Melody05 Excel Discussion (Misc queries) 2 June 29th 05 12:20 PM
When I save a file I consistently get a message about saving a co. cynspin Excel Discussion (Misc queries) 2 February 1st 05 10:30 PM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"