VB conflict with WIndows XP and Windows '07

HotNumbers

Well-known Member
Joined
Feb 14, 2005
Messages
732
Can someone please help me modify the following code. I have two group of users some are on XP and some are on WINDOWS 07. Those that are on XP the following VB code works as written. However; the group that is now on WINDOWS 07 they are receiving the following error.

WINDOWS 07 ERROR MSG:

Run-time Error '75:
Path/File access error.

'Open a new .txt file for output
NewFileName = "C:\" + NewSheetName + ".txt"
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
This probably has to do with windows 7 built in protection. It will not allow you to write to the c: drive directly. You should never do that anyway as it is bad practice. I would suggest writing to the desktop.

Code:
sUserProfile = Environ("USERPROFILE") & "\Desktop\"

should work for both OSs
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,713
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top