Hello, this is my first thread on the forum because i'm really out of ideas now.
For my work, i'm trying to make our requests forms easier to feel.
Therefore, i've created an excel workbook (which is protected by a password) with 7 sheets: the first one ("Global_data") is used to get the informations of the requestor and the employee if needed, the 6 others are the different requests form ("Material",Network","CN",...).
These ones must stay hidden until all the fields in Global_data are filled.
For that i've created the macro:
Private Sub Worksheet_Change(ByVal Target As Range)
If Sheets("Global_data").Range("G23").Value = 6 Then
ActiveWorkbook.Unprotect Password:="****"
Sheets("Material").Visible = True
Sheets("Network").Visible = True
Sheets("SAP REQUEST").Visible = True
Sheets("CN Approval").Visible = True
Sheets("PO Approval").Visible = True
Sheets("VIM Approval").Visible = True
Sheets("Material").Select
ActiveSheet.Range("D22").Select
ActiveWorkbook.Protect Password:="****", Structure:=True, Windows:=False
End If
End Sub
But i've also added the following macro so that the user full name would automatically be filled in cell D14 in the sheet Global_data.
Private Sub Workbook_open()
Dim WSHnet As Object
Dim Username As String
Dim userdomain As String
Dim objuser As Object
Dim userfullname As String
Sheets("Global_data").Select
Set WSHnet = CreateObject("WScript.Network")
Username = WSHnet.Username
userdomain = WSHnet.userdomain
Set objuser = GetObject("WinNT://" & userdomain & "/" & Username & ",user")
userfullname = objuser.FullName
MsgBox "User Full Name: " & vbCrLf & vbCrLf & userfullname, vbInformation, "User Full Name"
Range("D14").Value = userfullname
End Sub
If i test my file on my pc, it seems working perfectly. also if i send it to some colleagues. Their name is filled in and the hidden sheets shown when all the required fields are filled.
However, if i upload my file on our Intranet i always get this kind of error "error 1004 method range of object _worksheet failed".
I guess the problem comes because i first do an even on workbook_open by filling cell D14 in the sheet Global_data while the second macro is a worksheet_change based on the same sheet. but i really don't know how to solve this?
Can someone help me out please?? 
Thanks a lot
Bookmarks