#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default not saving a file

Say you have a workbook with 33 worksheets.

You run your code to save the activesheet as a .CSV file (32 other sheets aren't
saved in this .CSV file).

Excel is persistent enough to warn you when you close this file (now a .csv
file) that you may lose lots of stuff (data and formulas and formatting and...).

So it always reminds you when you close that file.

And even if you only had one worksheet to start, you could still be losing
formulas, formatting, ... so it reminds you then, too.

Maybe it would be better to change your code to save the .CSV file differently:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim newWks As Worksheet
Dim myFileName As String

Set wks = Worksheets("whateveroneyouwanthere")

myFileName = wks.Range("x99").Value

wks.Copy 'to a new workbook
Set newWks = ActiveSheet

With newWks
Application.DisplayAlerts = False
.Parent.SaveAs Filename:="C:\TEMP\" & myFileName, _
FileFormat:=xlCSV
Application.DisplayAlerts = True
.Parent.Close savechanges:=False
End With

End Sub

I saved to the C:\temp folder

stevekirk wrote:

HI,

I save a file by using a varilbe from a cell then it saves to a CSV
file then it asks if ni want to save changes. and i do not want to save
the file

i have used the FALSE statement but this does not work

thanks
steve
:)

--
stevekirk
------------------------------------------------------------------------
stevekirk's Profile: http://www.excelforum.com/member.php...o&userid=37328
View this thread: http://www.excelforum.com/showthread...hreadid=571304


--

Dave Peterson
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
editing an excel 97 file within excel 2003 and saving back as exce Chris Egebrecht Excel Discussion (Misc queries) 3 March 24th 06 11:14 PM
Excel should let me sort the file directory when saving a file Beanee70 Excel Discussion (Misc queries) 0 March 14th 06 07:03 AM
saving an excel file as text without text in quotes John Excel Discussion (Misc queries) 2 December 6th 05 06:20 PM
saving excel file as tab delimited Craig Hilliard Excel Discussion (Misc queries) 0 February 1st 05 10:39 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM


All times are GMT +1. The time now is 12:48 PM.

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

About Us

"It's about Microsoft Excel"