Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a file

Status
Not open for further replies.

camjon

Technical User
Apr 2, 2008
17
US
I am learning how to program in VB right now, I just want to know what is the syntax for opening a file, I know how to do it in C++ but im confused on how to do it in VBA
 
VB, or VBA? This is a VBA forum.

A great tool for learning VBA is to turn on your macro recorder and do whatever you want, then observe the generated code.

If you're in Excel, you can turn in on by going to Tools > Macro > Record New Macro.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Im am using vba, i apologize for the confusion....but thank you for the advice
 
I should also mention that the code that is generated by the Macro Recorder is sometimes (if not often) bloated.

It's still a great way to see how things are done and learn syntax, but feel free to post what you come up with for tips on trimming it down.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
google
"file open vba"
returns a ridiculous number of hits, the 1st of which is:


or as John says, you can use Tools>Macro>Record New Macro



Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Ok, Thanks again....I will play with the macros
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top