ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy from unopened workbook (https://www.excelbanter.com/excel-programming/334091-copy-unopened-workbook.html)

Emma Hope

copy from unopened workbook
 
Dear All,

I hope you can help with this query. I have inherited a workbook which
copies information from other workbooks. To do this it opens the workbook
(supplying the password), goes to the correct sheet and then copies the
selected range to the first workbook. The problem is that each of the our
workbook it needs to open are over 10Mb each and takes quite a long time to
open.

I wonder if it is possible to copy the information without opening the
workbook? The workbooks to be copied from are password protected.

Also if this is possible, is it possible to apply a filter in the closed
workbook so that only the a certain number of lines are copied across and
also currently the copying takes lines 2 to 10,000 to ensure that all lines
are copied, is it possible to somehow detect the last row of the data? There
are blank lines in the data every so often if this is important.

We have winXp, Office 2000 and all workbooks are password protected.

Thanks very much
Emma

Bob Phillips[_7_]

copy from unopened workbook
 
Normally you could use ADO to read the closed workbook, but not if it is
password protected.

If you do open them, you can find the last line of data with

iLastRow = Cells(Rows.Count,"A").End(xlUp).Row

--
HTH

Bob Phillips

"Emma Hope" wrote in message
...
Dear All,

I hope you can help with this query. I have inherited a workbook which
copies information from other workbooks. To do this it opens the workbook
(supplying the password), goes to the correct sheet and then copies the
selected range to the first workbook. The problem is that each of the our
workbook it needs to open are over 10Mb each and takes quite a long time

to
open.

I wonder if it is possible to copy the information without opening the
workbook? The workbooks to be copied from are password protected.

Also if this is possible, is it possible to apply a filter in the closed
workbook so that only the a certain number of lines are copied across and
also currently the copying takes lines 2 to 10,000 to ensure that all

lines
are copied, is it possible to somehow detect the last row of the data?

There
are blank lines in the data every so often if this is important.

We have winXp, Office 2000 and all workbooks are password protected.

Thanks very much
Emma




Frank

copy from unopened workbook
 
Why not just run queries in your VB code ...

Private Sub msubUpdateTable()

DoCmd.RunSQL "DELETE FROM tblMyTable WHERE intID = 9"
DoCmd.RunSQL "UPDATE tblMyTable SET intID = " & txtMyTextBox & " WHERE
intID = 9"

End Sub

Cheers ...

"Emma Hope" wrote:

Dear All,

I hope you can help with this query. I have inherited a workbook which
copies information from other workbooks. To do this it opens the workbook
(supplying the password), goes to the correct sheet and then copies the
selected range to the first workbook. The problem is that each of the our
workbook it needs to open are over 10Mb each and takes quite a long time to
open.

I wonder if it is possible to copy the information without opening the
workbook? The workbooks to be copied from are password protected.

Also if this is possible, is it possible to apply a filter in the closed
workbook so that only the a certain number of lines are copied across and
also currently the copying takes lines 2 to 10,000 to ensure that all lines
are copied, is it possible to somehow detect the last row of the data? There
are blank lines in the data every so often if this is important.

We have winXp, Office 2000 and all workbooks are password protected.

Thanks very much
Emma



All times are GMT +1. The time now is 09:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com