Re: access data from a closed wb protected with password without o

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: error message
    ... I don't know what was causing that particular workbook to attach itself to ... every excel file I was saving but after I repaired my Excel and shut down my ... "Dave Peterson" wrote: ... I have an EXcel file that every time opens gives me a error message telling ...
    (microsoft.public.excel.misc)
  • Re: open CSV.file
    ... "Dave Peterson" wrote: ... after this iam able to change the format manually in format ... below code but the file still opens in a US format. ... Dim TempWkbk As Workbook ...
    (microsoft.public.excel.programming)
  • Re: Manual Calculation in Excel 2000
    ... "Dave Peterson" wrote: ... I'm still betting that you have another workbook that opens and tells excel how ... I'd look to see what other files are opened when excel starts. ...
    (microsoft.public.excel.misc)
  • Re: Reset workbook back to Auto Calculate
    ... "Dave Peterson" wrote: ... Maybe you have a workbook in that folder. ... Sometimes those other folders can be hard to find. ... that opens when I first start Excel is in Automatic mode. ...
    (microsoft.public.excel.misc)
  • Re: open CSV.file
    ... Ranjith Kurian wrote: ... "Dave Peterson" wrote: ... below code but the file still opens in a US format. ... Dim TempWkbk As Workbook ...
    (microsoft.public.excel.programming)