Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default "Path/File Access Error" on Sheets.Copy

After searching Google, despite many post started about this error
occurring, I could not find any explanation or solution, so I'll try again.
This runs fine sometimes, but can then error for some unknown reason. A
restart of Excel, log off/log on, Windows can make a difference, but not
always.
Certainly only 1 instance of Excel running.
File name or path may have Chinese in it, but I don't think that's the
cause.

--------- Code -----------------------
Dim WBSpecs As Workbook

On Error GoTo cmdGetWS_Click_Error

Response = Excel.Application.GetOpenFileName("HK Spec Files (*.xls), *.xls",
, "Select the Spec Sheet to cost.")
If Response < False Then

Set WBSpecs = Workbooks.Open(Response)
With WBSpecs
.Sheets(1).Copy Befo=ThisWorkbook.Sheets("Costings")
.Sheets(2).Copy Befo=ThisWorkbook.Sheets("Costings")
.Close False
End With

Set WBSpecs = Nothing
--------- Code -----------------------

It bombs on ".Sheets(1).Copy Before..." with the error msg "Path/File Access
Error" '.\VBxx.tmp'".
Watching the folder containing the open workbook, the file VBxx.tmp is only
created after the error box appears.
Error handler on, so how is this error generating it's own unhandled error ?

Any help greatly appreciated.

NickHK


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default "Path/File Access Error" on Sheets.Copy

I wonder if it is because of slow server response to the creation of th
.tmp file.

Try adding a delay of a second or two into the code :-
Application.Wait Now + TimeValue("00:00:02") ' =2 second

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default "Path/File Access Error" on Sheets.Copy

.......... after the WorkBooks.Open line

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default "Path/File Access Error" on Sheets.Copy

BrianB,
Thanks for the input, but it does seem to connected with opening the file
from a path that contains Chinese characters, on the network (running W2K
Chinese) or my computer (running W2K English). Chinese characters in the
file name do not cause a problem.
I can open the file no problem and .Save, but .SaveAs and Sheets.Copy (and
possibly other methods) error.
The temp file that's created (in the folder of the opened file) upon failure
is always zero bytes.

NickHK


"BrianB " wrote in message
...
I wonder if it is because of slow server response to the creation of the
tmp file.

Try adding a delay of a second or two into the code :-
Application.Wait Now + TimeValue("00:00:02") ' =2 seconds


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default "Path/File Access Error" on Sheets.Copy

Nick
I have a similar problem...were you able to find the cause of error ...and solution for that. I would appreciate if you could share that . An email will be appreciated :

Thanks
Aji

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel error: "The path you entered, ---------- , is too long. " 1122Andy Excel Discussion (Misc queries) 1 April 13th 10 01:18 AM
Selecting "Save As" adds "Copy of" to file name- MS Excel 2007 ronhansen Excel Discussion (Misc queries) 1 November 15th 09 09:33 PM
error message "excel cannot access office" jazzyb Excel Discussion (Misc queries) 0 June 12th 06 10:43 AM
"Cannot access read-only document" (I get this error when I try to open an Excel file) [email protected] Excel Discussion (Misc queries) 1 June 5th 06 01:15 PM
"Cannot access read-only document" (I get this error when I try to open an Excel file) [email protected] Setting up and Configuration of Excel 1 June 5th 06 01:15 PM


All times are GMT +1. The time now is 06:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"