ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trying to save as tab delimited (https://www.excelbanter.com/excel-programming/288512-trying-save-tab-delimited.html)

A man

Trying to save as tab delimited
 
Hi,
I have Excel 2000 on Win 2000 and I am trying to save the active
worksheet as a tab delimited file. This is what I've tried:
Dim i As Integer
Dim ws As Worksheet

ws = ActiveWorkbook.SaveAs("13031t.txt", xlTextWindows)

But I keep getting an error on the "Saveas" saying it needs a valid
function. So how do I do this?

Also, what is the file format for a tab delim file? Excel VBA help
does not say, it just lists the file format constants.

Thanks

--
Say no to fixed width tables. They look terrible in all browsers.

Jim Rech

Trying to save as tab delimited
 
The Workbook SaveAs method does not return a worksheet. Try:

ActiveWorkbook.SaveAs "13031t.txt", xlTextWindows


--
Jim Rech
Excel MVP



A man

Trying to save as tab delimited
 
On Tue, 20 Jan 2004 11:59:16 -0500 in article <uUEKxa33DHA.360
@TK2MSFTNGP12.phx.gbl, spoke thusly...
The Workbook SaveAs method does not return a worksheet. Try:

ActiveWorkbook.SaveAs "13031t.txt", xlTextWindows


Thanks. That worked! But I wonder why with the parentheses it didn't
work and yours did. Because I had also tried:
Activeworkbook.SaveAs("13031.txt", xlTextWindows)

--
Say no to fixed width tables. They look terrible in all browsers.

Jim Rech

Trying to save as tab delimited
 
But I wonder why with the parentheses

In VB when you using a returned result you use parens, else not:

Dim WB as Workbook
Set WB = Workbooks.Open("MyBook.xls")

or

Workbooks.Open "MyBook.xls"

--
Jim Rech
Excel MVP




All times are GMT +1. The time now is 05:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com