Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
editing an excel 97 file within excel 2003 and saving back as exce | Excel Discussion (Misc queries) | |||
Excel should let me sort the file directory when saving a file | Excel Discussion (Misc queries) | |||
saving an excel file as text without text in quotes | Excel Discussion (Misc queries) | |||
saving excel file as tab delimited | Excel Discussion (Misc queries) | |||
Weekly Transaction Processing | Excel Worksheet Functions |