View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Read variables from external file

Basically you question is how do I read a textfile. There is no built in
support for writing variable values to a text file, but you can write
information to a text file, then read it in an assign the values to
variables.

http://support.microsoft.com/support...eio/fileio.asp
File Access with Visual Basic® for Applications

--
Regards,
Tom Ogilvy

"Daniel Köster" wrote in message
...
Hello again averyone,

How do I kame a macro read some of its variables from an external file?

The
thing is that I need the user to be able to change some basic values in

the
macro, like pathnames and stuff.

I would like to have a txt file with the contents:
variable1 = "c:\work\myfile.xls"
variable2 ="yes"
variable3 = "1978"
and then let the macro get the varibles and there value from that file.

I know how to do it in Macromedia flash.. :-)

--
--------------------------------------------------------
Daniel Köster
TEKNOTRANS AB
Redegatan 13
426 77 Västra Frölunda
Sweden
Tel: +46 31 69 47 60
Fax: +46 31 69 47 65
E-mail:
http://www.teknotrans.com