Shared workbook problem!

Kentman

Active Member
Joined
Apr 26, 2010
Messages
257
I have a workbook that works fine except when I share it. Clicking the OK button on a userform causes the following error:

'1004'
'Application-defined or object-defined error'

The worksheets are protected but this only happens once I share it not at any other time.

Microsoft says: "This issue may occur if one or more of the cells in an array (range of cells) contain a character string that is set to contain more than 911 characters."
But I don't have any data in any of the sheets as I'm testing a blank version!

Does anyone know what it means or is referring to or how to stop this?

Any help would be greatly appreciated as I'm on the last leg of a long development.
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
This doesn't answer your question, but if I were you I would avoid using shared workbooks. They are highly unreliable when it comes to data integrity.

That said, what line of code is causing the error?
 

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
Shared workbooks are pure evil and whilst they can work they often cause as many problems as they fix.

Can you post the code that is run when you click the OK button?

Dom
 

Kentman

Active Member
Joined
Apr 26, 2010
Messages
257
As it only happens when in 'shared' mode I can't debug as it doesn't allow access to the project.

The code executed is below:

Private Sub CmdButNewOK_Click()
Dim SNTDay, SNTMonth, SNTYear, SNTDate As String
Dim SUPERDay, SUPERMonth, SUPERYear, SUPERDate As String
Dim DISPDay, DISPMonth, DISPYear, DISPDate As String
Dim SNTHour, SNTMinute, SNTTime As String
Application.ScreenUpdating = False
'check to see if they picked a ward
If SheetPicked = "" Then
MsgBox "You must select a Ward from the list!"
Exit Sub
End If
'Select worksheet picked and move to the first blank row
ActiveWorkbook.Sheets(SheetPicked).Activate
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then 'If there's something in the row..
ActiveCell.Offset(1, 0).Select 'move to the next row
End If
Loop Until IsEmpty(ActiveCell) = True 'Keep doing this until you find the first empty row
ActiveCell.Offset(0, 25) = Range("Control!A90") 'This is the current date and time of the new record
'---------------------------------------------------------------------------------------
'Start getting values from dialog box
'SNT Section
ActiveCell.Value = SheetPicked
'Area label value is automatically input via the Ward drop down code
ActiveCell.Offset(0, 1) = Me.Lbl_AREA

If Me.TB_INTREF.Value > "" Then
ActiveCell.Offset(0, 2) = Me.TB_INTREF.Value
Else
ActiveCell.Offset(0, 2) = "Not Entered"
End If
SNTDay = Combo_DAY.Value
SNTMonth = Combo_MONTH.Value
SNTYear = Combo_YEAR.Value
SNTMinute = ComboMINUTE.Value
SNTHour = ComboHOUR.Value
'Construct date from VARs
SNTDate = SNTDay & "/" & SNTMonth & "/" & SNTYear
ActiveCell.Offset(0, 3) = SNTDate
'Construct time from VARs
SNTTime = SNTHour & ":" & SNTMinute
ActiveCell.Offset(0, 4) = SNTTime

'Information for drop-down comes off the Control Sheet from the named range 'Input_Type'
If Me.ComboINPUTTYPE.Value = "" Then
ActiveCell.Offset(0, 5) = "Not Entered"
Else
ActiveCell.Offset(0, 5) = Me.ComboINPUTTYPE.Value
End If
If Me.Tb_INPUTTYPECOMMENT.Value > "" Then
ActiveCell.Offset(0, 6) = Me.Tb_INPUTTYPECOMMENT.Value
Else
ActiveCell.Offset(0, 6) = "Not Entered"
End If
'Information for drop-down comes off the Control Sheet from the named range 'Input_Type_Summary'
If Me.ComboINPUTTYPESUM.Value = "" Then
ActiveCell.Offset(0, 7) = "Not Entered"
Else
ActiveCell.Offset(0, 7) = Me.ComboINPUTTYPESUM.Value
End If
If Me.Tb_ORIGIN.Value > "" Then
ActiveCell.Offset(0, 8) = Me.Tb_ORIGIN.Value
Else
ActiveCell.Offset(0, 8) = "Not Entered"
End If
'---------------------------------------------------------------------------------------
'Location Section
If Me.Tb_FNAME.Value > "" Then
ActiveCell.Offset(0, 9) = Me.Tb_FNAME.Value
Else
ActiveCell.Offset(0, 9) = "Not Entered"
End If
If Me.Tb_LNAME.Value > "" Then
ActiveCell.Offset(0, 10) = Me.Tb_LNAME.Value
Else
ActiveCell.Offset(0, 10) = "Not Entered"
End If
If Me.Tb_ADDRESS.Value > "" Then
ActiveCell.Offset(0, 11) = Me.Tb_ADDRESS.Value
Else
ActiveCell.Offset(0, 11) = "Not Entered"
End If
If Me.Tb_PHONE.Value > "" Then
ActiveCell.Offset(0, 12) = Me.Tb_PHONE.Value
Else
ActiveCell.Offset(0, 12) = "Not Entered"
End If
If Me.Tb_EMAIL > "" Then
ActiveCell.Offset(0, 13) = Me.Tb_EMAIL
Else
ActiveCell.Offset(0, 13) = "Not Entered"
End If
If Me.Tb_MESSAGE > "" Then
ActiveCell.Offset(0, 14) = Me.Tb_MESSAGE
Else
ActiveCell.Offset(0, 14) = "Not Entered"
End If

'---------------------------------------------------------------------------------------
'Supervision Section

If Me.Tb_SUPER.Value > "" Then
ActiveCell.Offset(0, 15) = Me.Tb_SUPER.Value
Else
ActiveCell.Offset(0, 15) = "Not Entered"
End If

If Me.Tb_ACTION.Value > "" Then
ActiveCell.Offset(0, 16) = Me.Tb_ACTION.Value
Else
ActiveCell.Offset(0, 16) = "Not Entered"
End If
'Get supervision date
SUPERDay = Combo_DD.Value
SUPERMonth = ComboMM.Value
SUPERYear = ComboYYYY.Value
'Construct date for record
SUPERDate = SUPERDay & "/" & SUPERMonth & "/" & SUPERYear
ActiveCell.Offset(0, 17) = SUPERDate

If Me.Tb_OFFICER.Value > "" Then
ActiveCell.Offset(0, 18) = Me.Tb_OFFICER.Value
Else
ActiveCell.Offset(0, 18) = "Not Entered"
End If

'---------------------------------------------------------------------------------------
'Disposal Section
'Column Q
If Me.Tb_DISPREF.Value > "" Then
ActiveCell.Offset(0, 19) = Me.Tb_DISPREF.Value
Else
ActiveCell.Offset(0, 19) = "Not Entered"
End If
'Column R
If Chk_APPROVE = True Then
ActiveCell.Offset(0, 20) = "Y"
Else
ActiveCell.Offset(0, 20) = "Not Entered"
End If
'Column S
If Chk_DISPOSAL = True Then
ActiveCell.Offset(0, 21) = "Y"
Else
ActiveCell.Offset(0, 21) = "Not Entered"
End If
'Disposal date
DISPDay = ComboDISPDAY.Value
DISPMonth = ComboDISPMONTH.Value
DISPYear = ComboDISPYEAR.Value
'Construct disposal date for record
DISPDate = DISPDay & "/" & DISPMonth & "/" & DISPYear

If Chk_DISPOSAL = True Then
ActiveCell.Offset(0, 22) = DISPDate
Else
ActiveCell.Offset(0, 22) = "Not Entered"
End If
'---------------------------------------------------------------------------------------
'Notes Section
If Me.Tb_NOTES.Value > "" Then
ActiveCell.Offset(0, 23) = Me.Tb_NOTES.Value
Else
ActiveCell.Offset(0, 23) = "Not Entered"
End If
ActiveCell.Offset(0, 24) = Me.Tb_OFFICER.Value 'This is the logged on user entering the new record
'Copies the unique reference formula into this record
Range("AB2:AF2").Select
Selection.Copy
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'Copy the conditional format to this row
Range("A2:U2").Select
Selection.Copy
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select

ActiveWorkbook.Sheets("Start").Activate
Application.ScreenUpdating = True
Unload Me
End Sub
 

Kentman

Active Member
Joined
Apr 26, 2010
Messages
257
If a shared workbook is a problem does anyone have any suggestions as to how I can share a workbook for multi-editing over a network - these criteria have to remain I afraid?
 

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
Yep, use Access.

I'll have a look at the code when I get a few minutes.

Please remember to use code tags when posting code in future.

Dom
 

Kentman

Active Member
Joined
Apr 26, 2010
Messages
257
Yep, use Access.

Please remember to use code tags when posting code in future.

Dom
Dom - Access - not an option

Don't know what you mean by code tags:(
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
I don't see anything obvious in that code. But have a look at the topic 'Limitations of shared workbooks' in Excel Help.

For example, you can't define or apply conditional formats, so while your copy/paste special formats code doesn't cause an error, the conditional formats won't be pasted. That's from testing in Excel 2000.
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,105,974
Messages
5,508,512
Members
408,688
Latest member
Bhojraj

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top