Re: access data from a closed wb protected with password without o
- From: Dave Peterson <petersod@xxxxxxxxxxxxxxxx>
- Date: Fri, 03 Aug 2007 07:40:03 -0500
I pasted that code that uses the API call from the wrong saved message.
It looks like that previous posted message locks just excel--not the desktop
(including the taskbar).
Here's one that locks the entire desktop:
Option Explicit
Private Declare Function LockWindowUpdate Lib "USER32" _
(ByVal hwndLock As Long) As Long
Private Declare Function GetDesktopWindow Lib "USER32" () As Long
Sub WindowUpdating(Enabled As Boolean)
'Completely Locks the Whole Application Screen Area,
'including dialogs and the mouse.
Dim Res As Long
If Enabled Then
LockWindowUpdate 0
'Unlock screen area
Else
Res = LockWindowUpdate(GetDesktopWindow)
'Lock at desktop level
End If
End Sub
Sub testme01()
Call WindowUpdating(False)
'do the work
Call WindowUpdating(True)
End Sub
Haresh wrote:
Hi Dave
i tried using this code and its still flashing in the taskbar when the wb
opens(sorry i mentioned toolbar last time) . is there anyting else i can do
to resolve this
regards
Haresh
"Dave Peterson" wrote:
Maybe you could hide that workbook's window.
dim wkbk as workbook
dim myWin as window
set wkbk = workbooks.open(...)
for each mywin in wkbk.windows
mywin.visible = false
next mywin
don't save that workbook with the windows hidden. It may be confusing the next
time you open the workbook.
Haresh wrote:
Hi dave just returned from sickness and Thanks very much for reply. i have
tried your code and its worked fine but there another samll prob. the wb that
opens does not flash on the screen but it shows in the tool bar at the time
of opening. is there a way get rid of this as well. actually i am trying to
import some data from several closed wb and each wb is named after differnt
users name and i dont want the user to get the impression that i am opening
the wb with their name as it flashes in the toolbar.
any help will be much appreciated!
Thanks again
Haresh
"Dave Peterson" wrote:
Sometimes, you can stop the flashing of the workbooks opening with:
application.screenupdating = false
'do lots of work
application.screenupdating = true
You may have to disable events when you open the other workbooks, too. They
could do something that toggles that setting.
Haresh wrote:
Hi
i am new to Excel programming and not sure if i am doing somthing stupid
i wanted to average the data from several closed wb into a single cell of
open wb. i am using the following formula in the cell and it woks fine if the
wb are not protected.
=AVERAGE('C:\Haresh\[trial.xls]Sheet1!B10,'C:\Haresh\[Courses.xls]Sheet1!E10)
if the wb are protected then it asks for password for each of the closed wb.
the problem is the no. of closed wb from which i may need to copy data may be
10 15 20 or more which means the user will have to enter password for every
wb before the result appears in that cell.
is ther a way to put password directly in the formula or
i know that i can open the closed wb using macro and also provide password
automatically and access the data required and then close the wb but this
flashes the wbwhich i dont really want. is there a way to access the closed
wb through a macro and providing the password automatically without having to
open the closed workbook
Thanks for help in advance!
--
Dave Peterson
--
Dave Peterson
--
Dave Peterson
.
- References:
- Prev by Date: Re: Useful code
- Next by Date: Re: Chart Error when using Chart Line - Column on 2 Axes in vba co
- Previous by thread: Re: access data from a closed wb protected with password without o
- Next by thread: Code Problems
- Index(es):
Relevant Pages
|