Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default "Open with.. Excel" in vb

I use a program that outputs a large text file of numerical data. The output
of the program can be set such that using the "Open with Excel.." command in
Windows automatically gives a neat, aligned data set in Excel with headers in
the correct places etc. (with excel text wizard this is a long process)

How can the "Open with Excel.." command be activated using vb in Excel?
Thanks

Mo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default "Open with.. Excel" in vb

Workbooks.OpenText (arg1, arg2, ...).

See help file for more info.

HTH,
arunkhemlai


"Jose Mourinho" wrote:

I use a program that outputs a large text file of numerical data. The output
of the program can be set such that using the "Open with Excel.." command in
Windows automatically gives a neat, aligned data set in Excel with headers in
the correct places etc. (with excel text wizard this is a long process)

How can the "Open with Excel.." command be activated using vb in Excel?
Thanks

Mo

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default "Open with.. Excel" in vb

Thanks, this is the same command that is used by my current macro though it
is not sorting data correctly.
However, if I manually use "Open with Excel" command on the text document
(right-click document in Explorer, select Open with...Excel) then everything
works fine: with the Workbook.OpenText sub it doesn't.

Perhaps the question should be
- what are the inbuilt arguments for this "Open with Excel.." command?

Jose

"arunkhemlai" wrote:

Workbooks.OpenText (arg1, arg2, ...).

See help file for more info.

HTH,
arunkhemlai


"Jose Mourinho" wrote:

I use a program that outputs a large text file of numerical data. The output
of the program can be set such that using the "Open with Excel.." command in
Windows automatically gives a neat, aligned data set in Excel with headers in
the correct places etc. (with excel text wizard this is a long process)

How can the "Open with Excel.." command be activated using vb in Excel?
Thanks

Mo

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default "Open with.. Excel" in vb

You can try if the following works for you, else people in win32.programmer
group might be able to help.


' --------------------------------
Option Explicit

' Must add reference to "Windows Scripting Host Object Model
' Your AntiVirus program might prevent the script from running.

Sub CallExcel()

Dim WshShell
Set WshShell = CreateObject("WScript.Shell")

WshShell.Exec ("excel ""C:\Documents and
Settings\Administrator\Desktop\yourfile.txt""")

Set WshShell = Nothing

End Sub

' --------------------------------


arunkhemlai

"Jose Mourinho" wrote:

Thanks, this is the same command that is used by my current macro though it
is not sorting data correctly.
However, if I manually use "Open with Excel" command on the text document
(right-click document in Explorer, select Open with...Excel) then everything
works fine: with the Workbook.OpenText sub it doesn't.

Perhaps the question should be
- what are the inbuilt arguments for this "Open with Excel.." command?

Jose



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
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Excel Discussion (Misc queries) 0 April 23rd 09 08:53 PM
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Setting up and Configuration of Excel 0 April 23rd 09 08:53 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
conditional formula to show "open" or "closed" SBS Excel Worksheet Functions 6 January 28th 06 01:48 AM
Standard "Open" and "Save As" Buttons Paulo de Arruda Borelli[_2_] Excel Programming 2 September 2nd 04 06:59 AM


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