![]() |
Read variables from external file
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 |
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 |
Read variables from external file
Hi Tom, Thanks for the reply!
I´ll try that, should work fine! Best Regards Daniel "Tom Ogilvy" skrev i meddelandet ... 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 |
All times are GMT +1. The time now is 05:28 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com