.xls file disappeared automatically

P

phui

I got a problem on company's logbook using Excel sheet. Recently it
happened twice, Excel sheet changed to another format file called
"File" with the random letter name such D123AB. What I am doing
recently is remotely copy this Excel file to a server, the code like
this:


Dim ExcelAp As New Excel.Application
Dim ExcelWb As Excel.Workbook
Dim ExcelWs As Excel.Worksheet
Dim i, j, k As Integer
Dim Filename As String
Dim ErrInfo As String
Dim Index, Temp_Index As Integer

Set ExcelWb = ExcelAp.Workbooks.Open("x:\logbook.xls") '.Add
ExcelWb.SaveCopyAs ("w:\br\logbook.xls")
ExcelWb.Close
ExcelAp.Quit
Set ExcelWb = Nothing
Set ExcelAp=Nothing
 
N

Nick Hodge

You are doing nothing wrong, but the server is somehow upsetting the save
process (XL saves a file to a temp file, that's the name your seeing, when
it's completed it renames the file). I suspect if you temporarily changed
the destination to a local drive, all would be well.

It could be anything really. Novell networks have had issues with this,
overactive virus scanners disturbing the save process, etc.

Code looks fine and I would not suspect XL, just something interrupting it's
delicate save process.

If this doesn't work, you could try the simpler, SaveAs

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top