Shared workbook problem!

Kentman

Active Member
Joined
Apr 26, 2010
Messages
260
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.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Not that it will fix your problem but one suggestion would be to avoid using activecell and select. Selecting cells in particular is almost never necessary when you are writing VBA.

For example the first part of your code can be written like this:

Code:
Private Sub CmdButNewOK_Click()
Dim wsWritesheet As Worksheet
Dim lngWriteRow As Long

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
Set wsWritesheet = ActiveWorkbook.Sheets(SheetPicked)
lngWriteRow = wsWritesheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
wsWritesheet.Range("Z" & lngWriteRow) = Now 'This is the current date and time of the new record

You also need to ensure if you are exiting your code part way through a procedure that you turn back on things like events and screen updating.

Dom
 
Upvote 0

Forum statistics

Threads
1,216,170
Messages
6,129,277
Members
449,498
Latest member
Lee_ray

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top