Access an ini file with vba

Q

quixote

Could someone show me an example of using an ini file to access a file
path/name. I don't want to hardcode network paths within my program but would
rather have them reference externally. Also would need an example of the
syntax in the ini file.
Here is kinda what I need.

INI file:
myWorksheet = "\\xxxbns03\drv_A\FolderName\Template.xls"

VBA:
oExcel.Workbooks.Open myFile.INI "myWorksheet"



Thanks in advance
 
D

Douglas J. Steele

See whether what Randy Birch has at
http://vbnet.mvps.org/code/file/pprofilebasic.htm is enough to get you
going.

(Obligatory warning: Randy's site is aimed at VB programmers. Since there
are significant differences between what controls are available for forms in
VB vs. Access, some of his code samples do not port directly into Access.
I'm reasonably certain, though, that this particular one should without
significant problems)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top