Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SaveAs CSV problem


I'm using a simple Macro to save a workbook as CSV but the file is neve
saved. The code runs fine but nothing happens

Sheet2.SaveAs "C:\oko", xlCSV

I have tried different version of this code but nope.

I'm using Office XP and the funny thing is that this seems to run fin
on Office 2002.

Pittur

--
pittu
-----------------------------------------------------------------------
pittur's Profile: http://www.excelforum.com/member.php...fo&userid=2436
View this thread: http://www.excelforum.com/showthread.php?threadid=37960

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default SaveAs CSV problem


I see there appears to be a difference between xlXP and xl2003
to the SaveAs methods applied to a sheet.

Following seems to work in both however:

(note the use of LOCAL requires xl2002 and above)
note Local should also be specified when opening
the CSV.
UI will open local =true by default.
VBA will open local=false by default

I DO specify a csv file extension..
if not the funny thing is that
Sheet2.SaveAs "c:\ok", , xlCSV, local:=False

will popup a warning if ok.XLS !!!
exists in that location

Sub SaveAsCSV()
Dim sName
sName = ThisWorkbook.FullName
Sheet2.SaveAs "c:\ok.csv", , xlCSV, local:=False
ThisWorkbook.SaveAs sName, xlWorkbookNormal

End Sub


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


pittur wrote :


I'm using a simple Macro to save a workbook as CSV but the file is
never saved. The code runs fine but nothing happens

Sheet2.SaveAs "C:\oko", xlCSV

I have tried different version of this code but nope.

I'm using Office XP and the funny thing is that this seems to run fine
on Office 2002.

Pittur.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default SaveAs CSV problem

Maybe you could just copy that sheet to a new workbook, then save it there and
finally close that new workbook:

sheet2.copy
activeworkbook.saveas "C:\oko", xlCSV
activeworkbook.close savechanges:=false



pittur wrote:

I'm using a simple Macro to save a workbook as CSV but the file is never
saved. The code runs fine but nothing happens

Sheet2.SaveAs "C:\oko", xlCSV

I have tried different version of this code but nope.

I'm using Office XP and the funny thing is that this seems to run fine
on Office 2002.

Pittur.

--
pittur
------------------------------------------------------------------------
pittur's Profile: http://www.excelforum.com/member.php...o&userid=24363
View this thread: http://www.excelforum.com/showthread...hreadid=379603


--

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
Help with saveas ftp file problem jmoffat[_13_] Excel Programming 3 June 13th 05 03:19 PM
SaveAs Problem Don Lloyd Excel Programming 7 January 11th 05 10:54 AM
ActiveWorkbook.SaveAs Problem SowBelly Excel Programming 4 August 4th 04 10:58 PM
SaveAS w/ a variable name problem Jeffp Excel Programming 2 June 8th 04 12:51 PM
SaveAs problem Jessi Excel Programming 2 July 31st 03 07:36 PM


All times are GMT +1. The time now is 06:30 AM.

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"