Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default need help using send keys


Hi,

I have a workbook which is password protected which I would like t
open as read-only.

I managed to get it to work if i used the following

Sub Macro1()

'cancel password which is Stewart

'Dim extractor As String
'extractor = ThisWorkbook.Name

'make file read-only
Application.SendKeys ("%r") '("stewart~")
Workbooks.Open Filename:= _
"C:\Documents and Settings\ME\Desktop\Test.xls"
Sheets("home").Select

' ActiveWindow.Close

End Sub

however when I run the sendkeys function it works however it places th
word stewart which is the password in my code any where that I have th
cursor. Is there a way I could stop this

--
funkymonkU
-----------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...fo&userid=1813
View this thread: http://www.excelforum.com/showthread.php?threadid=55258

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default need help using send keys

here is one way:

Sub Macro1()

'cancel password which is Stewart

'Dim extractor As String
'extractor = ThisWorkbook.Name

'make file read-only

Workbooks.Open Filename:= _
"C:\Documents and Settings\ME\Desktop\Test.xls", _
Password:="stewart"
Sheets("home").Select

' ActiveWindow.Close

End Sub

I am not sure how that makes the file readonly, however.

--
Regards,
Tom Ogilvy


"funkymonkUK" wrote:


Hi,

I have a workbook which is password protected which I would like to
open as read-only.

I managed to get it to work if i used the following

Sub Macro1()

'cancel password which is Stewart

'Dim extractor As String
'extractor = ThisWorkbook.Name

'make file read-only
Application.SendKeys ("%r") '("stewart~")
Workbooks.Open Filename:= _
"C:\Documents and Settings\ME\Desktop\Test.xls"
Sheets("home").Select

' ActiveWindow.Close

End Sub

however when I run the sendkeys function it works however it places the
word stewart which is the password in my code any where that I have the
cursor. Is there a way I could stop this?


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=552580


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
SEND KEYS?????? Please.... help... nisgore Excel Programming 1 October 20th 05 11:59 AM
Send Keys Sgwapt Excel Programming 1 August 7th 05 02:03 AM
send keys ksnapp[_52_] Excel Programming 2 April 9th 04 06:41 AM
Send Keys Akshay Bakhai Excel Programming 1 August 22nd 03 03:33 PM
Send Keys pancho[_14_] Excel Programming 1 August 21st 03 07:54 PM


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