ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA code to open file? (https://www.excelbanter.com/excel-programming/286479-vba-code-open-file.html)

pgoodale[_2_]

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/


Tomek[_5_]

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/




Leo Elbertse

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/



Nigel[_8_]

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 =---

Don Guillett[_4_]

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/





All times are GMT +1. The time now is 09:42 AM.

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