Runtime error ------ shared workbook macro execution

beach

New Member
Joined
Feb 1, 2004
Messages
38
I have a "set-up" macro that sets the print area, hides a number of columns, and filters certain remaining colums to suit the particular report being generated, and halts to allow the user to preview the filtered data..

As a part of the set up, the macro also sets the properties of an autoshape from "no fill, no line" (ie hidden), to "red fill, black line" (ie visible), and changes cell g10 font properties to display a message, which was sitting cunningly ?? hidden by being formatted white font. The now visible auto shape has been pre-assigned a further macro ready to re-set the filters, unhide the columns etc, (and then re-hide itself) ready for the next report. [Having written this down here, it seems (and probably is) horribly primitive, but bear in mind I'm a civil engineer who writes VB code by keystroking and fine tuning, not a programmer, and at least it half works !!]


Everything is fine until I try and share the workbook, across an NT network.
The sharing opens up OK, but when a user trys the macro, he/she gets the following message displayed ....

Runtime error '-2147467259 (80004005)':
Method of 'Select' of object 'Shape' failed.

And at that point the macro stops executing, but because it is in shared mode, VB editor de-bugger is not available to trace the error.


Is there any way around this..........


VB context help suggests a code line "On error resume" put in somewhere before the object properties fiddling, (or something like that....but I don't know how to syntax it.


Any assistance ????


I have appended the relevant macro code below.


TextInput = InputBox("Please enter Project Leaders initials", " 3 Initials Required")
Sheets("CURRENT JOBS").Range("D15") = TextInput
Sheets("INDATA").Select
Selection.AutoFilter Field:=126, Criteria1:="TRUE"
Selection.AutoFilter Field:=106, Criteria1:="TRUE"
Selection.AutoFilter Field:=78, Criteria1:="FALSE"
Application.Goto Reference:="PROJLEADERHIDE"
Selection.EntireColumn.Hidden = True
Range("G10").Select
With Selection.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveSheet.Shapes("Oval 1364").Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 10
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 64
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Range("C10").Select


End Sub


Thanks for your interest

Beach
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

beach

New Member
Joined
Feb 1, 2004
Messages
38
having worked out the answer to your own question - (usually obvious, it just needs writing down and trying to explain to someone else,), how does one "UN-POST" ie cancel the thread

Cheers
 

Forum statistics

Threads
1,143,656
Messages
5,720,116
Members
422,266
Latest member
Mattyw

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
Top