Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
sujay
 
Posts: n/a
Default how to convert .xls to .csv in VB ?

Hi all,
I am new to VBA and Excel stuff.
I am trying to convert .xls file to .html.
I am successeded in that, but when i am trying to convert another .xls
file to .csv the previously generated .csv file gets lost, i..e it is
not seen, may be it get replace with new file(though names are
different).
Is any body getting same problem.

I want to save previous .csv file also.

Reply soon


Thank you


sujay

  #2   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default how to convert .xls to .csv in VB ?


sujay wrote:
Hi all,
I am new to VBA and Excel stuff.
I am trying to convert .xls file to .html.
I am successeded in that, but when i am trying to convert another .xls
file to .csv the previously generated .csv file gets lost, i..e it is
not seen, may be it get replace with new file(though names are
different).
Is any body getting same problem.

I want to save previous .csv file also.

Reply soon


Thank you


sujay



Hi Suiay,

You can use the followinf piece of code in any subroutine you like:

ActiveWorkbook.SaveAs Filename:="FileName", FileFormat:= _
xlCSVMSDOS, CreateBackup:=False

FileName: is the Complete file path you want to save the CSV in it.

hope it works.

Hesham Elhadad

  #4   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default how to convert .xls to .csv in VB ?

sujay wrote:
Hi Hesham Elhadad
Thank you !
but it will work only one time, i.e. if I convert another .xls to .csv,
the previously generated .csv file get lost and new file get generated

how can i solve this problem.


Thank you

sujay.



wrote:
sujay wrote:
Hi all,
I am new to VBA and Excel stuff.
I am trying to convert .xls file to .html.
I am successeded in that, but when i am trying to convert another .xls
file to .csv the previously generated .csv file gets lost, i..e it is
not seen, may be it get replace with new file(though names are
different).
Is any body getting same problem.

I want to save previous .csv file also.

Reply soon


Thank you


sujay



Hi Suiay,

You can use the followinf piece of code in any subroutine you like:

ActiveWorkbook.SaveAs Filename:="FileName", FileFormat:= _
xlCSVMSDOS, CreateBackup:=False

FileName: is the Complete file path you want to save the CSV in it.

hope it works.

Hesham Elhadad


If you are using the same file name ...it should do what you said...
However, if you use another file name it will be another file and keep
both of them

the following code may help and you can change to customize your needs:


DestFile = InputBox(Filename)

ActiveWorkbook.SaveAs Filename:=DestFile, FileFormat:= _
xlCSVMSDOS, CreateBackup:=False
the DestFile is the complete Path and File name you want to save ...
it will save it and keep the old one as it is a new file...

Regards,

Hesham Elhadad

  #5   Report Post  
Posted to microsoft.public.excel.misc
sujay
 
Posts: n/a
Default how to convert .xls to .csv in VB ?

Hi Hesham Elhadad
Thank you !
I am not using the same file name, though my previous .csv file lost, I
don't know why this is happning.
I have tried what u have given but same problem found.
Is there are any parameter other than you have given?


thank you

sujay.





wrote:
sujay wrote:
Hi Hesham Elhadad
Thank you !
but it will work only one time, i.e. if I convert another .xls to .csv,
the previously generated .csv file get lost and new file get generated

how can i solve this problem.


Thank you

sujay.



wrote:
sujay wrote:
Hi all,
I am new to VBA and Excel stuff.
I am trying to convert .xls file to .html.
I am successeded in that, but when i am trying to convert another .xls
file to .csv the previously generated .csv file gets lost, i..e it is
not seen, may be it get replace with new file(though names are
different).
Is any body getting same problem.

I want to save previous .csv file also.

Reply soon


Thank you


sujay


Hi Suiay,

You can use the followinf piece of code in any subroutine you like:

ActiveWorkbook.SaveAs Filename:="FileName", FileFormat:= _
xlCSVMSDOS, CreateBackup:=False

FileName: is the Complete file path you want to save the CSV in it.

hope it works.

Hesham Elhadad


If you are using the same file name ...it should do what you said...
However, if you use another file name it will be another file and keep
both of them

the following code may help and you can change to customize your needs:


DestFile = InputBox(Filename)

ActiveWorkbook.SaveAs Filename:=DestFile, FileFormat:= _
xlCSVMSDOS, CreateBackup:=False
the DestFile is the complete Path and File name you want to save ...
it will save it and keep the old one as it is a new file...

Regards,

Hesham Elhadad


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
how to convert .xls to .csv? sujay Excel Discussion (Misc queries) 1 June 28th 06 12:35 PM
HOW DO I CONVERT .CSV FILE TO .XLS? Dave McCuen Excel Discussion (Misc queries) 5 March 22nd 06 12:00 AM
convert from .xls format to .csv format m_ravindran Excel Discussion (Misc queries) 1 November 9th 05 11:22 AM
Convert .csv files nc Excel Discussion (Misc queries) 3 October 6th 05 02:24 PM
When converting an .xls file to .csv I get too many commas at the. One-eyed-Ian Excel Discussion (Misc queries) 3 December 7th 04 12:03 AM


All times are GMT +1. The time now is 11:39 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"