A wierd phenomenon (excel uses OS environment settings???)

robfritts

New Member
Joined
Apr 28, 2002
Messages
18
This is just an FYI that I discovered with a co-worker while working on some code we borrowed from a few example on this site. Sorry for the length, wanted to be sure and cover all the bases.

Operating environment:
NT 4, Excel 97 - SR2

Scenario:
open, copy, and close an external data report

Problem:
On my machine it worked well, I sent the master file to a co-worker and it cratered with error code '9' on the point where I told it to activate & close the new workbook created when it opened the external file.
I diagnosed it on his machine and inserted a message box just above the error point to tell me what excel/vba thought the value for variable PathName was (I use PathName as the variable where the user pastes the web URL for the report since it changes every time it runs). It responded with the valid URL (like http://www.blahblahblah.com/file.ext). We then exited the message box and let the macro fail, then checked the window it was trying to close. Excel had opened the file sure enough, but it didn't open it with the extension on the end of it!!!

Solution:
It appears that Excel (and other MS products???) take envorinment variables from their OS. On a hunch, I had my co-worker go to Windows Explorer -> View-> Options -> view (tab) and uncheck "hide file extensions of known files." Closed and restarted Excel and that didn't fix it. Rebooted the system w/ the new setting and it DID fix it. Now when he accesses external files in Excel, it includes the extensions in the name and when we reran the macro code, it successfully completed.

Anyway, I'm sure you guys already noticed this, but I thought it was really really strange that the Excel operating envorinment wasn't absolute, meaning that you could develop the workbook app on one PC and it won't work on another if their OS environment settings aren't exactly the same. STRANGE!!




_________________
Regards,

Rob Fritts
This message was edited by robfritts on 2002-04-30 00:02
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,213,544
Messages
6,114,239
Members
448,555
Latest member
RobertJones1986

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