LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro drops date formatting to csv file

Hi,
I have a macro that pulls data from a database and formats it prior
to saving it into a csv file. This macro has worked perfectly for 6-7
months but recently it has started to fail. The date formatting does
not save into the csv file. Below is the coding...

ActiveSheet.Rows(1).Delete
Columns("A:A").EntireColumn.AutoFit
wk.Sheets("sheet1").Range("B:C,H:H").Select
wk.Sheets("sheet1").Range("H1").Activate
Selection.NumberFormat = "m/d/yy h:mm"
wk.Sheets("sheet1").Columns("E:F").Select
Selection.NumberFormat = "0.000000"
wk.Sheets("sheet1").Range("B1").Select
Selection.Sort Key1:=wk.Sheets("sheet1").Range("B1"),
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom

PivotName = "aep_tx_forecast_cc_short_" & Format(GetValTime,
"yyyymmdd")
wk.SaveAs "Y:\ALLEGRO-UPLOAD\LSHAPES\PROD\TEXAS\" & PivotName,
xlCSV
'wk.Close (False)

As you can see i have recently commented out the close command. If I
don't close the file and manually resave, the file saves the formatting
correctly. So basically, only manually saving the file will give me
the date formatting I need. Any thoughts?

I am running Excel2000 9.0.4402 SR-1

Thanks!



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

 
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
Date value conditional formatting or Macro Wanna Learn Excel Discussion (Misc queries) 0 July 22nd 08 01:01 PM
Date Formatting in a Macro [email protected] Excel Discussion (Misc queries) 3 May 19th 06 02:09 AM
Click on cell-calendar drops down-click on date-date fills cell. . George Setting up and Configuration of Excel 1 April 15th 05 08:22 AM
csv file drops zeros at beginning of a set of Numbers Lisa Excel Discussion (Misc queries) 2 January 8th 05 08:53 PM
Formatting Date Macro Sarah[_4_] Excel Programming 4 October 15th 03 03:12 PM


All times are GMT +1. The time now is 08:21 AM.

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"