Check Username On File Start Up
Oct 28, 2009
i have a spreadsheet with the following worksheets:
"Data Entry" (sheet 1)
"Menu" (sheet 2)
"Username" (sheet 3)
In username the range a2:b5 contains the following:
a2= John b2=Write
a3=Scott b3=Readonly
where John or Scott are usernames in Environ("Username")
Is it possible to write a macro that does the following:
1. When the file is opened it looks at the network username and checks again the Username range in sheet3, if it is Write then the user can change cells in Data Entry and save the workbook, if Readonly then they can only view and not save, and if not there at all, then the worksheet closes.
2. When the file is opened write a log in a hidden sheet callled "Log" of the time opened and the username
3. Is it possible to do the same but making a copy of all cells changed ??
View 3 Replies
ADVERTISEMENT
Aug 20, 2008
I was able to get some help a while ago and hoping for someone to reply as well. Any one have ideas how to create a userform which will be use for username and password input? I know how to create one but is there anyway that the username and password will be stored as .txt file instead of using worksheet to store the data?
View 14 Replies
View Related
Feb 2, 2010
I have bit of code that:
(1) opens another spreadsheet
(2) updates that spreadsheet
(3) saves that spreadsheet
(4) closes that spreadsheet
If the spreadsheet that requires updating is open by another user, I display a message indicating the file is open and no updates occured. There are about 20 persons within the organization that may have this file open? Is there away to display the username of the person who has the file open?.
View 4 Replies
View Related
Oct 5, 2007
I have a thousand names on a column, and I have a several worksheet tabs as locations, such as CA, AZ, TX, and NY.
All names goes to main worksheet, show like this
apitchford 10 100 123
bkishpaugh 9 211 123
blee 14 234 111
cbonny 21 125 412
I need to pull a specific name, example, name = blee, move that name with all data on that row into TX.
I will need to set as automatically, becuase the names add and delete on the main worksheet, and will auto update those tab worksheets. (make sense?)
I have tried INDEX and MATCH, but they keep putting one data in, not all data.
View 9 Replies
View Related
Aug 21, 2013
getting the username of an unshared file on network. When I click on file I'll get this message "...already open by " its blank.
I have found 1 code but it is not working on office 2013. VBA function to get username of open file on network?
View 4 Replies
View Related
Mar 23, 2014
I have Excel Sheet that open with user name and password.
Like if it's open my Admin - he can view all Sheets
If open by any user - it opens only users sheet.
Problem is once file is saved by any users, all hidden files get unhidden and Admin Sheet is open.
Requirement: if User1 saves file other sheets should not get unhidden.
View 1 Replies
View Related
Mar 16, 2009
I've borowed the below from this forum but how do I get OR into the username chek below? If Environ("username") <> "Simon" OR "Paul" OR "David" Then
View 3 Replies
View Related
Aug 26, 2006
how to write a new line to a csv file? Or how to write a "Character return" to the file? I use the following code to write a line but I don't know the command to start a new line. Write #1, "abc",
View 2 Replies
View Related
Aug 15, 2012
I have a delivery time programm (clients to be delivered the next day) which I would like to run every night at a specific time. Is there any MS tool to trigger the Excel file? Or do we have to use the "old" batch file ( if yes, pls send example)?
View 2 Replies
View Related
Sep 28, 2008
I use an image analysis program ImagePro which can call Excel within it's macro language (which seems to be visual basic). I looked up on this site how the change the drive (ChDrive command). But still when the Excel section (after With oExcel) executes the default file location in the browser is in My Documents on the C: drive.
Prior to this code Excel has been launched by this ImagePro macro, and a file Cumberland Template has been opened from the C: drive. Now I would like to do a Save As, but have Excel start at the I: drive location.
View 7 Replies
View Related
Nov 18, 2009
In the code below, I am trying to add code that will verify that the file to be opened is actually there. If it's not, I want a message box to tell the user that the file is missing or not there. My efforts have XXXXXXXXXXXXXXX above and below my inserted code. Sorry, but I'm lost and need a method of advising the user via a message.
View 3 Replies
View Related
Oct 4, 2006
How do I check to see if a particular file exists using Visual Basic
View 2 Replies
View Related
May 26, 2014
I want to create something like this: macro checking if file aaa.csv isn't open, if it is macro should stop and show message box "Close aaa.csv", and if file isn't open it should continue to work.
The file aaa.csv is stored in the same folder as workbook with my macro.
View 3 Replies
View Related
Nov 8, 2007
I have an excel spreadsheet used to populate word documents based on a template file that is loaded like this....
View 9 Replies
View Related
Nov 7, 2008
It checks to see if DataImport2, 3 and 4 exist and then executes code.
Currently DataImport4 does not exist so it should not execute anycode but for some reason the code is still trying to execute it and select Sheets("DataImport4").Select
View 5 Replies
View Related
Oct 2, 2012
How can I check if a file exists with VBA?
View 3 Replies
View Related
Jan 3, 2009
I am using below mentioned Code for checking if certain file exist on Path.
Its working on my home PC (XP SP2 Excel 2003).
BUT its not working on my office PC (XP SP2 Excel 2003).
Can somebody tell me why its not working in my office PC ( or if its missing something, then from where can i download it.)
Sub CheckFiles()
Const strFolder = "C:Documents and SettingskreshnrDesktopTest"
Dim fso, msg, i
Dim rngData As Range
Set fso = CreateObject("Scripting.FileSystemObject")
Set rngData = Sheets("Sheet1").Range("A1")
With rngData
Do While .Offset(i, 0).Value ""
If (fso.FileExists(strFolder & .Offset(i, 0).Value & ". ")) Then
.Offset(i, 2).Value = "Yes"
Else
.Offset(i, 2).Value = "No"
End If
i = i + 1
Loop
End With
End Sub
View 9 Replies
View Related
May 2, 2006
I can use a FileDialog to have a file selected. But I still need to check if it really exists before continuing. How to do?
(I know there is a function FileExists but do not know how to use it with FileDialog if this is the way to do it)
View 9 Replies
View Related
Dec 19, 2006
I have a form in Access with a button that opens an Excel file. I think I've seen vba code to tell if a specific Excel file is open already. What I'm looking for is a way to tell if an Excel file is already open when you don't know the filename of the Excel file. Is that possible? Or at the very least is there a way to be able to tell if Excel is already open?
View 4 Replies
View Related
Apr 2, 2007
i want to improve some of my application by testing if a folder is accessible to the user... i've got some code to check if a file is already is use which is useful... but before that we have folders in work that are only accessible to certain users for reporting and if the person doesn't have access to it within a macro it Errors out... i'd like some kind of macro to display a message box like windows does... Directory is not accessible, Access Violation... it has to check directly for the Accessible part and not just an error...
View 2 Replies
View Related
Jul 5, 2014
how I could perform a simple file path check using excel.
For example:
File Path
Exists
C:ImagesMatrix.png
Yes
C:ImagesCubic.png
No
View 5 Replies
View Related
Oct 27, 2008
I have an application that requires users to download a file from a location that is then imported at their execution into the application. I've done my best to counsel users to download the file to their desktop (for ease of locating) and to stick with a standard filename so that there are no errors. Some of these people just don't take direction well, will save the file wherever, or save the name inappropratly, or worse, open up multiple copies of the same file corrupting the name: ie: FileName.xls, FileName.xls(1), FileName1.
View 5 Replies
View Related
Jul 17, 2009
I am just wondering if there is a way of checking if the workbook that is currently open is the only one that is open, as I have been asked to make my code exit the application if this is the case rather that just close that one file.
View 6 Replies
View Related
Jul 21, 2009
The other day, I had posted a macro, which copies one of the sheets from a workbook, on to a blank sheet, and then saves it with a name obtained from the value of cell E7. I required certain modifications to it, before I could implement it.
You will find it here and the code looks like this:
View 10 Replies
View Related
Jun 21, 2013
I'm creating a template xlsm file that has built in marcos. This file will be used by the Engineer as a template, where they fill in the data, and then send it to the team. when the case in finished, they will use clear data macro.
The Problem I want the template to have a macro runs with startup of the file that checks for the lastest template in a network folder (shared folder where they will have read only access). If the used file is the latest one, OK. If not, give a custom msg with the location on the network.
View 6 Replies
View Related
Mar 2, 2007
way to find out if an Excel file is open from PowerPoint. I know there are ways to open the Excel file, but you can get a warning message if the file is already open. So I want to check to see if it is open first before I go to the code that opens it.
View 9 Replies
View Related
Mar 26, 2008
I have a spreadsheet with a macro that saves a backup s/s to a particular folder, but the problem I have need the macro to check the filepath is that of the original s/s before running.
Its so that when people take copies of the main s/s and save them to their desktop I dont want the copies being saved in the backup folder
macro is below
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If ActiveWorkbook.ReadOnly Then Exit Sub
If MsgBox("Do You Want To Save A Backup?", vbYesNo) = vbNo Then Exit Sub
Dim fso As Object
Dim objFiles As Object
Dim myWkBk As String
Dim myFName As String
Dim BkUpDir As String
Dim CountFiles As Integer
Dim mydate As Double
BkUpDir = "k:singstatappealsappeals trackerBackups"
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFiles = fso.GetFolder(BkUpDir).Files
On Error Resume Next
'the actual counting of files takes place here.
If Err.Number 0 Then
CountFiles = 0
Else
CountFiles = objFiles.Count
End If
If CountFiles > 4 Then
MsgBox "You have " & CountFiles & " saved workbooks. Perhaps you should delete some?"
End If
mydate = Format(Now(), "ddmmyy")
myWkBk = ActiveWorkbook.Name
myFName = ActiveWorkbook.FullName
fso.CopyFile myFName, BkUpDir & mydate & myWkBk
End Sub
View 9 Replies
View Related
Jul 2, 2008
I have a macro used to save a worksheet, its placed on the DATA sheet.
is there a way so that when the user clicks this button each row 12:200 is checked for empty cells in that row (cells B:P). If a row is found the ref number in column A of each row is placed into next available row in Sheet3
For example :
A12 = 12345
A13 = 6789
A14 = 9876
A15 = 54321
the DATA sheet is populated with various data in rows 12:15
it is found that B12, L12, E14,F14,P15 all have no data, so the values of A12,A14 and A15 are placed into next row in Sheet3
Result in sheet3
A2= 12345 (valuse of A12 in DATA Sheet)
A3= 9876 (value of A14 in DATA Sheet)
A4= 54321 (value of A15 in DATA sheet)
Finally a message box to state there is missing data, for example
"there is missing data from refs 12345 , 9876 , 54321" ie the list pasted into sheet
View 9 Replies
View Related
Sep 18, 2009
I have a command that opens up another workbook. This workbook is sometimes open on another computer, so that the book opens up on my computer in write-protected mode (shows in the top of the window). Usually, when opening other books through the Excel functionality, a message box appears if the file is open and warns that the file is in use by another user. However, with the code I have at the moment, this is not the case when I try to open with my command. See code below:
Private Sub cmdOpenBook_Click()
'Open book
ChDir "I:DevelopmentSpecialUtvikling"
Workbooks.Open Filename:= _
"I:DevelopmentSpecialUtviklingJointApp.xls"
End Sub
Is there any way of displaying a msgbox warning when opening another file through VBA?
View 9 Replies
View Related
Jul 28, 2004
I have a program that opens an excel-workbook, I first check whether the file is opened by another user(open for read-write). This works fine, but I'd like to know which user has the file open with VBa code. ex.
workbooks.open ....
if open
then msgbox " Book opened by user"
end if
So it's the same as you open an excel(with your windows explorer) on a network and you get the message that the file is already opened by the user....
View 2 Replies
View Related