Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default A little help with SaveAs Method please

I have a VBA macro that opens a selected CSV file and executes. What is the
code required to make the macro save the CSV file as an Excel Workbook, with
the same name and in the same location?

Appreciate the help

thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default A little help with SaveAs Method please

Stitch,

Using the macro recorder and then modifying, I got this. It assumes the
book your saving is the activeworkbook:

Sub Test()
ActiveWorkbook.SaveAs Filename:= _
Replace(LCase(ActiveWorkbook.Name), "csv", "xls"), FileFormat:=xlNormal
_
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub

hth,

Doug

"Stitch45" wrote in message
...
I have a VBA macro that opens a selected CSV file and executes. What is
the code required to make the macro save the CSV file as an Excel Workbook,
with the same name and in the same location?

Appreciate the help

thanks



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
Problem using SaveAs method Sujata Excel Discussion (Misc queries) 4 March 30th 10 07:21 AM
SaveAs method error Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 3 October 6th 09 09:05 PM
Difficulties with SaveAs method aiyou Excel Programming 3 April 26th 05 02:51 AM
Question Using SaveAs Method R3df1sh Excel Programming 1 November 12th 03 07:26 PM
SaveAs method L Buchy Excel Programming 1 July 11th 03 11:27 PM


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