Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Naming A Worksheet

Hello,

In VB.net I am creating a CSV File.

With Excel
..SheetsInNewWorkbook = 1
..Workbooks.Add(1)
..Worksheets().Select()

(Create Columns and Rows)

When I save the file.

..Application.DisplayAlerts = False
..ActiveWorkbook().SaveAs("C:\MyCSV.csv",
..ActiveWorkbook.FileFormat.xlCSVWindows)
..ActiveWorkbook.Close()

The worksheet is named MyCSV, I want the worksheet to have a different name
than the saved file.

Any assistance will be greatly appreciated.

Thanks,

Chuck


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Naming A Worksheet

You can change the name of the worksheet. But I wouldn't bother. The next time
you open the .CSV file, excel will use what it wants for the worksheet
name--usually the name of that .csv file (without the .csv file extension).

So it's not your saving that's the problem. It's the reopening.

Since .csv files are plain old text, there's nothing you can do with the file
itself. You can always rename the worksheet after the file is reopened.


"Charles A. Lackman" wrote:

Hello,

In VB.net I am creating a CSV File.

With Excel
.SheetsInNewWorkbook = 1
.Workbooks.Add(1)
.Worksheets().Select()

(Create Columns and Rows)

When I save the file.

.Application.DisplayAlerts = False
.ActiveWorkbook().SaveAs("C:\MyCSV.csv",
.ActiveWorkbook.FileFormat.xlCSVWindows)
.ActiveWorkbook.Close()

The worksheet is named MyCSV, I want the worksheet to have a different name
than the saved file.

Any assistance will be greatly appreciated.

Thanks,

Chuck


--

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
naming worksheet tabs Jacob Skaria Excel Discussion (Misc queries) 3 May 27th 10 10:25 PM
Worksheet naming Woodstock Excel Discussion (Misc queries) 3 January 20th 09 10:35 PM
Naming worksheet Arne Hegefors Excel Programming 1 September 19th 06 10:38 AM
Naming Worksheet Denis New Users to Excel 2 September 13th 05 05:55 PM
Naming a worksheet help? pauldaddyadams Excel Worksheet Functions 1 August 9th 05 10:46 AM


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