Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Can't create ini file on a Vista machine

I tried the following in both Excel 2003 and 2007 on a Vista machine:

Sub Test()
Dim I As Integer
I = FreeFile
fName = "C:\aaa.ini"
Open fName For Output As #1
Print #1, "Test"
Close #1
End Sub

I get a Path/Fle access error on the Open line. The above works perfect in
other versions of Excel. I tried different folders and still no joy.

When I tried manually saving a workbook to the programs file directory where
the add-in was located, to the root C drive and to the windows temp
directory. , I get a "you don't have permissions" error message each time.
Most likely this is what is triggering the path/file error. I guess I could
save to the my documents directory, but the file is not one the user needs
to see. And if they see it, they are likely to delete

Any ideas on how to solve?

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Can't create ini file on a Vista machine

Hi Bob

C:\ is protected in Vista

Create a folder for your add-in in a unprotected area on you hard disk


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Bob Flanagan" wrote in message . ..
I tried the following in both Excel 2003 and 2007 on a Vista machine:

Sub Test()
Dim I As Integer
I = FreeFile
fName = "C:\aaa.ini"
Open fName For Output As #1
Print #1, "Test"
Close #1
End Sub

I get a Path/Fle access error on the Open line. The above works perfect in
other versions of Excel. I tried different folders and still no joy.

When I tried manually saving a workbook to the programs file directory where
the add-in was located, to the root C drive and to the windows temp
directory. , I get a "you don't have permissions" error message each time.
Most likely this is what is triggering the path/file error. I guess I could
save to the my documents directory, but the file is not one the user needs
to see. And if they see it, they are likely to delete

Any ideas on how to solve?

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Can't create ini file on a Vista machine

Hi Ron. This thread appeared finally in my news reader. Sounds like it
will be better to create registry entries instead. At lieast that can be
done across platforms.

Bob

"Ron de Bruin" wrote in message
...
Hi Bob

C:\ is protected in Vista

Create a folder for your add-in in a unprotected area on you hard disk


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Bob Flanagan" wrote in message
. ..
I tried the following in both Excel 2003 and 2007 on a Vista machine:

Sub Test()
Dim I As Integer
I = FreeFile
fName = "C:\aaa.ini"
Open fName For Output As #1
Print #1, "Test"
Close #1
End Sub

I get a Path/Fle access error on the Open line. The above works perfect
in other versions of Excel. I tried different folders and still no joy.

When I tried manually saving a workbook to the programs file directory
where the add-in was located, to the root C drive and to the windows temp
directory. , I get a "you don't have permissions" error message each
time. Most likely this is what is triggering the path/file error. I guess
I could save to the my documents directory, but the file is not one the
user needs to see. And if they see it, they are likely to delete

Any ideas on how to solve?

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Can't create ini file on a Vista machine

I don't know whether its just a typo, but you should have:

Sub Test()
Dim I As Integer
I = FreeFile
fName = "C:\aaa.ini"
Open fName For Output As I 'not #1
Print #I, "Test" 'not #1
Close I
End Sub

Just a thought.

Peter

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Can't create ini file on a Vista machine

Yes that is also a good option

In Vista if you copy a add-in in the Library folder and have a option in the add-in to change
things and save the changes in the Add-in then you also have a problem.

The Library folder is also protected


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Bob Flanagan" wrote in message ...
Hi Ron. This thread appeared finally in my news reader. Sounds like it
will be better to create registry entries instead. At lieast that can be
done across platforms.

Bob

"Ron de Bruin" wrote in message
...
Hi Bob

C:\ is protected in Vista

Create a folder for your add-in in a unprotected area on you hard disk


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Bob Flanagan" wrote in message
. ..
I tried the following in both Excel 2003 and 2007 on a Vista machine:

Sub Test()
Dim I As Integer
I = FreeFile
fName = "C:\aaa.ini"
Open fName For Output As #1
Print #1, "Test"
Close #1
End Sub

I get a Path/Fle access error on the Open line. The above works perfect
in other versions of Excel. I tried different folders and still no joy.

When I tried manually saving a workbook to the programs file directory
where the add-in was located, to the root C drive and to the windows temp
directory. , I get a "you don't have permissions" error message each
time. Most likely this is what is triggering the path/file error. I guess
I could save to the my documents directory, but the file is not one the
user needs to see. And if they see it, they are likely to delete

Any ideas on how to solve?

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can't create ini file on a Vista machine

Ron de Bruin wrote:
Hi Bob

C:\ is protected in Vista

Create a folder for your add-in in a unprotected area on you hard disk


Is there a way to make these protected areas into
unprotected areas?


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Can't create ini file on a Vista machine

Hi Mark

In the properties of a folder there is a security tab
You can chnage the security there
But not all Vista versions have that tab

Read this from help

***********
Why is the Security tab missing from my file and folder properties?

The Security tab is not available on file and folder properties in Windows Vista Home Premium,
Windows Vista Home Basic, and Windows Vista Starter.
The Security tab also is not available if you are using the FAT or FAT32 file system
*************

Use the users folder to avoid problems
"C:\Users\Ron\test\"

You can build the string with
Environ("UserName")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Mark Jones" wrote in message ink.net...
Ron de Bruin wrote:
Hi Bob

C:\ is protected in Vista

Create a folder for your add-in in a unprotected area on you hard disk


Is there a way to make these protected areas into
unprotected areas?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
File shows as locked on my machine only James from Sage Excel Discussion (Misc queries) 1 May 23rd 08 03:16 PM
Reference & update destin. cells on 1st machine from source workbook on 2nd machine. [email protected] Excel Discussion (Misc queries) 6 February 28th 06 05:15 AM
Corrupted Excel file - but on only one machine? k Excel Discussion (Misc queries) 2 May 31st 05 01:12 PM
Corrupted Excel file - but on only one machine? k Excel Programming 1 May 25th 05 03:46 PM
file transfer to/from a unix machine rajib Excel Programming 0 September 18th 03 03:54 PM


All times are GMT +1. The time now is 11:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"