Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to have a sheet withing a workbook keep a log of who opens
a workbook and when. I believe I'm running into problems because the workbook name has spaces in it. The code that I'm trying to use is Private Sub Workbook_Open (file with spaces in it.xls) Dim LastRow As Long LastRow = Sheets("Log").Range("A65000").End(xlUp).Row Sheets("Log").Cells(LastRow + 1, 1).Value = Now Sheets("Log").Cells(LastRow + 1, 2).Value = Application.UserName End Sub And the error i receive when I try to use this code is Compile error: Expected: list separator or ) The other code I tried to plug in was Private Sub Workbook_Open ("file with spaces in it.xls") Dim LastRow As Long LastRow = Sheets("Log").Range("A65000").End(xlUp).Row Sheets("Log").Cells(LastRow + 1, 1).Value = Now Sheets("Log").Cells(LastRow + 1, 2).Value = Application.UserName End Sub and the error I received was. Compile error: Expected: indentifier I'm sure there is an easy solution to my little problem, but I've just started fooling around with VBA and after searching for the last couple of weeks I've admitted I need to ask for help. So, thank you for any help any of you can send my way. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Matching names and inserting spaces | Excel Worksheet Functions | |||
Matching names and inserting spaces | Excel Worksheet Functions | |||
Open Excel file get error with file names that have spaces in the | Setting up and Configuration of Excel | |||
Formulas referencing a spaces instead of number ? | Excel Discussion (Misc queries) | |||
Spaces in sheet names | Excel Programming |