Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I have a read only xl file, I need it to be read and write | Excel Discussion (Misc queries) | |||
How can a file be converted from Read-Only to Read/Write | Excel Discussion (Misc queries) | |||
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. | Charts and Charting in Excel | |||
Variables in links and external file references | Links and Linking in Excel | |||
referencing external workbook using variables | Excel Programming |