Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem due to password

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Problem due to password

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Problem due to password

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem due to password

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
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
Asking for password problem Jgeurian21 Excel Discussion (Misc queries) 0 March 24th 10 09:51 PM
Password Problem Miki Excel Discussion (Misc queries) 9 September 5th 08 02:58 AM
password problem [email protected] New Users to Excel 2 June 28th 07 05:33 PM
password problem S S Excel Worksheet Functions 3 June 20th 07 10:18 PM
Password Problem Karen Excel Discussion (Misc queries) 4 March 15th 05 01:44 AM


All times are GMT +1. The time now is 12:28 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"