Hi Guys,
I am stumped with this error, which seems to be happening to only one of my users...
I have a long code, which starts with declarations including a sheet name. The sheet name is the current month in the form MMM-YY, e.g. 'Feb-15'. This is to select the worksheet in another workbook with that sheet name later on in the code.
The code that is highlighted when the user gets the run time error is the "strSheet =" line.![]()
Option Explicit Sub SaveButton_Click() Application.ScreenUpdating = False Application.Calculate Sheets("Copy").Range("CG1").Value = "some text goes here" PleaseWait.Show vbModeless DoEvents Sheets("Copy").Select Sheets("Copy").Range("D2:D9").Value = Sheets("ONE").Box1.Value Sheets("Copy").Range("E2:E9").Value = Sheets("TWO").Box2.Value Sheets("Copy").Range("A11:U18").Value = Sheets("Copy").Range("A2:U9").Value Dim FName As String Dim IsClosed As Boolean Dim strSheet As String Dim strTeam As String strSheet = Workbooks("Book1").Sheets("Copy").Range("D20") strTeam = Workbooks("Book1").Sheets("actions").Range("U54") FName = "//the file path goes here/" & strTeam & " - Log.xlsm" 'More Code Goes Here...... End Sub
"Book1" is the ActiveWorkbook where the code runs. "D20" has the formula "=TEXT(TODAY(),"MMM-YY")" and currently shows Feb-15 which is a valid sheet within the workbook that will open later (FName), (although when the code crashes, it is only setting the string name).
However, this code all runs fine for me, it's just happening to one user. Also, it was working all throughout January for him (when D20 showed Jan-15), only now in February it has stopped working, so maybe it is the Feb-15 bit??
Does anyone have any ideas on why it would crash on that line??
I was thinking maybe it is the user's own Excel settings?
Thanks,
ExcelNat











LinkBack URL
About LinkBacks
Register To Reply

Bookmarks