Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default File open - .xls not recognized as spreadsheet

I'm trying to write a macro where the first step is to turn control
over to the user to specify a spreadsheet file that is to be opened.
I am using the "Application.GetOpenFilename" command to do this.

It seems that even tho the file to be opened is a .xls file Excel
doesn't recognize it as a spreadsheet - it seems to treat this as a
text file. (Note: when I try to open this same .xls file Excel
responds by opening the Text Import Wizard window. Proceeding using
the default options then works fine.) How can I have the macro
proceed with the opening of the specified file by recognizing tabs as
the delimiter between the columns?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default File open - .xls not recognized as spreadsheet

try this

Workbooks.Open Filename:=Filename, Format:=2

Format Optional Variant. If Microsoft Excel is opening a text file, this
argument specifies the delimiter character, as shown in the following table.
If this argument is omitted, the current delimiter is used.

Value Delimiter
1 Tabs
2 Commas
3 Spaces
4 Semicolons
5 Nothing
6 Custom character (see the Delimiter argument)


" wrote:

I'm trying to write a macro where the first step is to turn control
over to the user to specify a spreadsheet file that is to be opened.
I am using the "Application.GetOpenFilename" command to do this.

It seems that even tho the file to be opened is a .xls file Excel
doesn't recognize it as a spreadsheet - it seems to treat this as a
text file. (Note: when I try to open this same .xls file Excel
responds by opening the Text Import Wizard window. Proceeding using
the default options then works fine.) How can I have the macro
proceed with the opening of the specified file by recognizing tabs as
the delimiter between the columns?


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
All columns not being recognized in .csv file. Decision Assist Excel Discussion (Misc queries) 3 October 17th 06 07:59 PM
.wks fil not recognized format if opening w/ Excel.How do I open? billyo Excel Discussion (Misc queries) 2 September 16th 06 03:55 PM
what do I download to open a spreadsheet file Lynny Excel Discussion (Misc queries) 1 February 26th 06 10:17 PM
Read XML based file that is recognized by Excel Peter[_56_] Excel Programming 0 October 23rd 05 02:00 PM
Why doesn't the spreadsheet file open. Piato Excel Discussion (Misc queries) 1 July 4th 05 09:05 PM


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