LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Workbook/Macro/Worksheet Protection...

I've seen a couple posts on this but did not see any direct answers.

I have a workbook that has protected worksheets inside, I have a macro
inside one of those protected worksheets that I would like everyone to be
able to access.

When I share the workbook and click on the macro I get a run time error.

I have added the "ActiveSheet.Protect UserInterfaceOnly:=True" and that
seems to work fine if the workbook is not shared (unprotects the sheet, runs
the macro, then protects it again). What would cause it not to work once I
activate sharing? And is there anything I can do to correct?

Macro is he
Sub Barcode()
ActiveSheet.Protect UserInterfaceOnly:=True
Dim ActRow As Integer
Dim Iloop As Integer
Dim shp As Shape
Dim rng As Range
Set shp = ActiveSheet.Shapes(Application.Caller)
Set rng = shp.TopLeftCell.Offset(0, 1)
rng.Value = Now

Application.ScreenUpdating = False
ActRow = rng.Row
Columns("A:B").Insert

For Iloop = 1 To 6
Cells(Iloop, "A") = Cells(2, Iloop + 2)
Cells(Iloop, "B") = Cells(ActRow, Iloop + 2)
Next Iloop
For Iloop = 12 To 14
Cells(Iloop - 5, "A") = Cells(2, Iloop + 2)
Cells(Iloop - 5, "B") = Cells(ActRow, Iloop + 2)
Next Iloop

Worksheets("Counts").Rows.RowHeight = 40

With Worksheets("Counts").Rows(9)
.RowHeight = .RowHeight * 3
End With
With Worksheets("Counts").Columns("A")
.ColumnWidth = .ColumnWidth * 5
End With
With Worksheets("Counts").Columns("B")
.ColumnWidth = .ColumnWidth * 8
End With
With Worksheets("Counts").Range("A1:B8")
.Font.Size = 30
With Worksheets("Counts").Range("B9")
.Font.Size = 160
End With
End With
Worksheets("Counts").Range("B9").Font.Name = "Free 3 of 9"

Range("A1:B15").PrintOut Copies:=1, Collate:=True

Worksheets("Counts").Rows.RowHeight = 25

Columns("A:B").Delete

Application.ScreenUpdating = False


End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
use a macro to automate excel worksheet password protection Bodyshopman Excel Discussion (Misc queries) 2 July 25th 07 01:21 AM
workbook Protection Toggle Macro Just Learning Excel Discussion (Misc queries) 3 August 30th 05 11:03 PM
Macro for worksheet protection Floss Excel Programming 5 July 8th 05 09:50 PM
customise button(macro) on toolbar / workbook protection tango Excel Programming 1 October 21st 04 10:49 AM
Worksheet/workbook protection property? brian Excel Programming 1 July 14th 03 07:43 PM


All times are GMT +1. The time now is 02:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"