Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to open file?
Does anyone know the line of code to open a file? I have created a macro
and am programming in VBA. All I need is the code which opens up files. Any help is really appreciated. --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to open file?
If You want to open an excel file use this:
Workbooks.Open file_name text file in Excel: Workbooks.OpenText file_name for example: Workbooks.OpenText filename:="DATA.TXT", _ dataType:=xlDelimited, tab:=True if it is a text file and You want to read from it: Open file_name For Input As #1 write to a file Open file_name For Output As #1 Read the online help for open method to get more info "pgoodale" wrote in message ... Does anyone know the line of code to open a file? I have created a macro and am programming in VBA. All I need is the code which opens up files. Any help is really appreciated. --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to open file?
You simply want to open a workbook?
Workbooks.Open "path" or something completely different, like a word file? Sub StartWinWord() Dim RetVal RetVal = Shell("C:\Program Files\Microsoft _ Office\Office10\WinWord.exe c:\boot.ini", 1) End Sub On Tue, 30 Dec 2003 03:31:55 -0600, pgoodale wrote: Does anyone know the line of code to open a file? I have created a macro and am programming in VBA. All I need is the code which opens up files. Any help is really appreciated. --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to open file?
Use the macro recorder to create the code you need, it is far simpler than
trying to work out the intricacies of writing the code directly, especially for simple code. Cheers N "pgoodale" wrote in message ... Does anyone know the line of code to open a file? I have created a macro and am programming in VBA. All I need is the code which opens up files. Any help is really appreciated. --- Message posted from http://www.ExcelForum.com/ ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to open file?
You could have posted your code for comments and suggestions. Or, you could
have looked in vba HELP index for OPEN We help those who help themselves. -- Don Guillett SalesAid Software "pgoodale" wrote in message ... Does anyone know the line of code to open a file? I have created a macro and am programming in VBA. All I need is the code which opens up files. Any help is really appreciated. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Which 'event' to run pivot chart formatting code on file open? | Charts and Charting in Excel | |||
open file with code | Excel Discussion (Misc queries) | |||
How to Open a file with the help of a code in Excel | New Users to Excel | |||
Code to Open Excel File Please Help | Excel Discussion (Misc queries) | |||
Use VBA code to open a text file with the import wizard | Excel Programming |