![]() |
Environ("USERNAME")
Hi all, I am in tension because this particular code is not working in my project. ActiveCell.Value = Environ("USERNAME") When I compile my project the cursor highlights this code and the reference book gets open automatically. Please suggest. Regards Heera Chavan |
Environ("USERNAME")
Break the line up into to line to help find the problem. I think the active
cell is the issue. You may have a workbook that is opening on a chart page and not a worksheet page which is giving you the problem, the cell is protected, or you are trying to write to a merge cell and not using the first cell or the merged group. UserName = Environ("USERNAME") ActiveCell.Value = UserName "Heera" wrote: Hi all, I am in tension because this particular code is not working in my project. ActiveCell.Value = Environ("USERNAME") When I compile my project the cursor highlights this code and the reference book gets open automatically. Please suggest. Regards Heera Chavan |
Environ("USERNAME")
tried it but it says compile error:
can't find project or libary. |
Environ("USERNAME")
Add a message box to find out what the UserName is set to.
UserName = Environ("USERNAME") msgbox(UserName) ActiveCell.Value = UserName If there is no username being display you have to find out what envirnomental properties are set in you PC. From XP Start - run type in the run box the following : cmd.exe A shell window will appear Type this at the command prompt : Set Your properties will be seen in this window. From vista Start - Search In the Search box type : CMD A shell window will appear Type this at the command prompt : Set Your properties will be seen in this window. "Heera" wrote: tried it but it says compile error: can't find project or libary. |
Environ("USERNAME")
Go into the VB editor and click Tools/References from its menu bar (could
take a few seconds for something to happen, so don't panic if it does)... is anything marked as "MISSING"? If so, put a check mark in its box, hit OK and then try your code again. -- Rick (MVP - Excel) "Heera" wrote in message ... tried it but it says compile error: can't find project or libary. |
Environ("USERNAME")
Thank you Rick your suggesstion was more appropriate......Joel your
trick helped me to increase my knowledge.... |
All times are GMT +1. The time now is 08:43 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com