Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a worksheet that I am launching from Access. I have code tha
tells Excel to Unprotect, then refresh, then protect again. It seem thought that Excel tries to Protect the sheet before the refres happens. Everytime that I try to run this, either from the Acces code, or directly from the Excel workbook Open Event it fails, sayin that it is protected. I need to be able to uprotect the workbook o worksheets indivdually, refresh my database query, the reprotect i all. Any ideas?? Here is what I have so far. It works fine if I take out the Protect statements. Thanks! Dim oApp As Object Set oApp = CreateObject("Excel.Application") oApp.Visible = True oApp.Workbooks.Open FileName:="c:\SalesSystem\PAL Deal.xls" 'Only XL 97 supports UserControl Property On Error Resume Next oApp.UserControl = True oApp.Worksheets("WAD").Unprotect oApp.Worksheets("PO1").Unprotect oApp.Worksheets("Data").Unprotect oApp.ActiveWorkbook.RefreshAll oApp.Worksheets("WAD").Protect oApp.Worksheets("PO1").Protect oApp.Worksheets("Data").Protect:confused -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Populate Order worksheet from Quote worksheet | Excel Worksheet Functions | |||
Cell Protection vs. Worksheet Protection | Excel Discussion (Misc queries) | |||
Worksheet 1 exact copy of worksheet 2, but in different order | Excel Discussion (Misc queries) | |||
Worksheet protection is gone and only wokbook protection can be se | Excel Discussion (Misc queries) | |||
Worksheet Protection | Excel Discussion (Misc queries) |