Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7627933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:31:38+00:00 2026-05-31T05:31:38+00:00

set application [::tcom::ref createobject Excel.Application] $application Visible 1 set workbooks [$application Workbooks] set workbook

  • 0
set application [::tcom::ref createobject "Excel.Application"]
$application Visible 1
set workbooks [$application Workbooks]
set workbook [$workbooks Add]
set worksheets [$workbook Worksheets]
set worksheet [$worksheets Item [expr 1]]
set cells [$worksheet Cells]
set rows [array size atten]
for {set row 1} {$row <= $rows} {incr row} {
    $cells Item $row "B" $atten($row)
}
$workbook SaveAs Filename {c:\tst.csv}
$application Quit

Hi.I’m able to write the data in CSV format. But the data is all corrupted. For example, when i opened it with notepad the data is corrupted, I mean i don’t see the data seperated by comma. Is there any problem with the method that i use to write the data to CSV format??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:31:39+00:00Added an answer on May 31, 2026 at 5:31 am

    Having the file name end in .csv isn’t enough to tell Excel to save as CSV. You have to pass a file type constant to the SaveAs method. Not sure about Tcl syntax, but I’m guessing the correct invocation of SaveAs would be

    $workbook SaveAs Filename {c:\tst.csv} FileFormat xlCSV
    

    SaveAs documentation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This does NOT work: Sub X() Dim A As Access.Application Set A = CreateObject(Access.Application)
The command $cells Item 2 A {SomeText} doesn't set the text in the cell
Django tutorials everywhere use constant-set application name all around - in urls file, in
- (void) applicationDidFinishLaunching:(UIApplication *)application { //set up main loop [NSTimer scheduledTimerWithTimeInterval:0.033 target:self selector:@selector(gameLoop:) userInfo:nil
I have a Java application set up as a service to do data-mining against
So I have a XNA application set up. The camera is in first person
I have the update frequency of my ClickOnce application set to weekly. What is
First I made an app and I set its application icon to a icon
Platform: Windows XP Development Platform: VB6 When trying to set an application title via
Can the application use set same char in the XON and XOFF? If yes,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.