Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can any one guide to solve out a problem.
I am reading a excel workbook from a Visual Basic application. I have to do work in this workbook. 1. I have to assign ToolTip to the particular cells. 2. I have to insert additional rows/columns. I have to do this as per the logic in Visual Basic application. The problem is that if the program gives run time error when the exce workbook is password protected and neither allow me to assign toolti nor the insert rows/columns. I m using the following commands ActiveWorkSheet.Cells(9, 9).AddComment "Testing ToolTips" Activework.Range("C9", "C9").EntireColumn.Insert xlShiftToRight Any help will be appreciated in this regard. : -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In xl2000 and earlier you can use the UserInteractiveOnly Property of the
protect method to work with the worksheet without knowing the password. You can check if the sheet is protected with Sub Tester5() If ActiveSheet.ProtectContents _ Or ActiveSheet.ProtectDrawingObjects _ Or ActiveSheet.ProtectScenarios Then On Error Resume Next ActiveSheet.Unprotect password:="" If Err.Number < 0 Then Err.Clear MsgBox "Sheet is password protected" Activesheet.Protect UserInteractiveOnly:=True End If On Error GoTo 0 End If End Sub In Excel 2002 and later, you would need to know the password. -- Regards, Tom Ogilvy "FuzzyLogic" wrote in message ... Can any one guide to solve out a problem. I am reading a excel workbook from a Visual Basic application. I have to do work in this workbook. 1. I have to assign ToolTip to the particular cells. 2. I have to insert additional rows/columns. I have to do this as per the logic in Visual Basic application. The problem is that if the program gives run time error when the excel workbook is password protected and neither allow me to assign tooltip nor the insert rows/columns. I m using the following commands ActiveWorkSheet.Cells(9, 9).AddComment "Testing ToolTips" Activework.Range("C9", "C9").EntireColumn.Insert xlShiftToRight Any help will be appreciated in this regard. :o --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Whoops, UserInterActiveOnly should be UserInterfaceOnly
Sub Tester5() If ActiveSheet.ProtectContents _ Or ActiveSheet.ProtectDrawingObjects _ Or ActiveSheet.ProtectScenarios Then On Error Resume Next ActiveSheet.Unprotect password:="" If Err.Number < 0 Then Err.Clear MsgBox "Sheet is password protected" Activesheet.Protect UserInterFaceOnly:=True End If On Error GoTo 0 End If End Sub -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... In xl2000 and earlier you can use the UserInteractiveOnly Property of the protect method to work with the worksheet without knowing the password. You can check if the sheet is protected with Sub Tester5() If ActiveSheet.ProtectContents _ Or ActiveSheet.ProtectDrawingObjects _ Or ActiveSheet.ProtectScenarios Then On Error Resume Next ActiveSheet.Unprotect password:="" If Err.Number < 0 Then Err.Clear MsgBox "Sheet is password protected" Activesheet.Protect UserInteractiveOnly:=True End If On Error GoTo 0 End If End Sub In Excel 2002 and later, you would need to know the password. -- Regards, Tom Ogilvy "FuzzyLogic" wrote in message ... Can any one guide to solve out a problem. I am reading a excel workbook from a Visual Basic application. I have to do work in this workbook. 1. I have to assign ToolTip to the particular cells. 2. I have to insert additional rows/columns. I have to do this as per the logic in Visual Basic application. The problem is that if the program gives run time error when the excel workbook is password protected and neither allow me to assign tooltip nor the insert rows/columns. I m using the following commands ActiveWorkSheet.Cells(9, 9).AddComment "Testing ToolTips" Activework.Range("C9", "C9").EntireColumn.Insert xlShiftToRight Any help will be appreciated in this regard. :o --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanx Tom
I will try according to your suggestion will inform u accordingly -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Asking for password problem | Excel Discussion (Misc queries) | |||
Password Problem | Excel Discussion (Misc queries) | |||
password problem | New Users to Excel | |||
password problem | Excel Worksheet Functions | |||
Password Problem | Excel Discussion (Misc queries) |