Error Number 3051

G

Guest

I am currently trying to import a spreadsheet from a shared drive. When I
call the spreadsheet through the "TransferSpreadsheet" command, I receive an
error stating "Cannot open file already opened exclusively by another user or
you do not have access to the file" I do have access to the file, but the
error occurs because there is currently another user having the file opened.
Is there a way to get around this or a code to automatically close ("kick")
the user off the file I'm trying to import?
 
G

Guest

Mybe, try and copy the excel file to another place and the run the import
from that place

x=shell("xcopy c:\FileName.xls c:\backup\")
And now you can import from the backup drive, without anyone lockng it.
 
G

Guest

Ofer,
This would work great, I just tested the code and it worked, but my MSDOS
prompt popped up asking if the file i was copying was a file or directory. Is
there a way to by pass this?
 
G

Guest

When you write the xcopy to write the name of the file
wrong: "xcopy c:\filename.xls c:\temp\Filename.xls" that will give you the
message
write: "xcopy c:\filename.xls c:\temp\"
 
G

Guest

OK, I just did that and it ran without any errors but when I went to see the
destination where I placed the copied file, there was nothing there. I ran it
several times and nothing was copied over. ???
 
G

Guest

Post your code
check if the file name spell correctly
check if the directory name spelled correctly

you can copy the xcopy line to the run window in windows and try it there.
 

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