Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-16-2023, 12:45 AM
soroush.kalantari soroush.kalantari is offline Error when moving (copying) a excel sheet to another workbook. Windows 10 Error when moving (copying) a excel sheet to another workbook. Office 2016
Competent Performer
Error when moving (copying) a excel sheet to another workbook.
 
Join Date: Jun 2021
Posts: 115
soroush.kalantari is on a distinguished road
Default Error when moving (copying) a excel sheet to another workbook.


Some times (not always), when I want to copy(move) one Excel sheet to another workbook (manually or by a macro), I encounter the error which is showed in the attached picture.(it usually get solved, when I restart the computer but again, It happens occasionally). Can you guide me on this issue?
Attached Images
File Type: png path not found.PNG (4.9 KB, 14 views)
Reply With Quote
  #2  
Old 10-16-2023, 01:29 PM
Logit Logit is offline Error when moving (copying) a excel sheet to another workbook. Windows 10 Error when moving (copying) a excel sheet to another workbook. Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Well ... the error code says Excel is unable to locate the path to the file which is named .\VB1A11.tmp

It is strange that the portion of that path begins with a period. Even if there is more to the path than what is displayed (all to the left of the period) it is unusual that portion would end with a period.

I experienced a path error not long ago and the reason was the macro had not created the .tmp (temp) file which was required to exist so the macro could write to the temp file.

Just a few thoughts for you to ponder.

Now ... without reviewing your entire code it will be impossible to determine if there is something needing revision.

On the other hand ... perhaps what you are experiencing is nothing more than an "Excel hiccup". Those are always frustrating.
Reply With Quote
  #3  
Old 10-16-2023, 09:48 PM
soroush.kalantari soroush.kalantari is offline Error when moving (copying) a excel sheet to another workbook. Windows 10 Error when moving (copying) a excel sheet to another workbook. Office 2016
Competent Performer
Error when moving (copying) a excel sheet to another workbook.
 
Join Date: Jun 2021
Posts: 115
soroush.kalantari is on a distinguished road
Default

Thank you for your reply. I have added one of my macros which sometimes encounters this error. (as I told, this issue is not related for a particular macro. And strangely it sometimes even occurs when I try to copy (move) sheets manually (without using macro))

Option Explicit

Sub saveboursview()
Dim ws0 As Workbook
Dim name0 As String
Application.DisplayAlerts = False
Set ws0 = ActiveWorkbook
Windows("tempalatecodal.xlsb").Activate
UserForm1.Show
name0 = Range("a1").Value
ws0.Activate
ActiveSheet.Copy Before:=Workbooks("tempalatecodal.xlsb").Sheets("u serform")
ActiveSheet.name = name0
Application.Run "'Personal.xlsb'!bourseview"
Application.Run "'Personal.xlsb'!replace0"
ws0.Close
Application.DisplayAlerts = True
End Sub

Last edited by soroush.kalantari; 10-17-2023 at 07:51 PM.
Reply With Quote
  #4  
Old 10-17-2023, 01:40 PM
Logit Logit is offline Error when moving (copying) a excel sheet to another workbook. Windows 10 Error when moving (copying) a excel sheet to another workbook. Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Again from my experience ... relating to the following line in your macro :

ActiveSheet.Copy Before:=Workbooks("tempalatecodal.xlsb").Sheets("u serform")

relating to : u serform

Assuming this is not a typographical error ... you desired to name the Sheet "Userform" but Excel rejected that because that name references an Excel object - a form. Then you utilized a space after the first letter because it changes the name to something Excel will accept ?

I've found Excel doesn't always accept names that include a space. Try adding an underscore ( _ ) to replace the space. Perhaps that will clear up your intermittent error issue.
Reply With Quote
  #5  
Old 10-17-2023, 08:00 PM
soroush.kalantari soroush.kalantari is offline Error when moving (copying) a excel sheet to another workbook. Windows 10 Error when moving (copying) a excel sheet to another workbook. Office 2016
Competent Performer
Error when moving (copying) a excel sheet to another workbook.
 
Join Date: Jun 2021
Posts: 115
soroush.kalantari is on a distinguished road
Default

I am Sorry. As the attached picture shows, in my code there is no space (the sheet name is “userform” not us erform). This space was unexpectedly created when I pasted the code to the site. (I tried to edit it, but it is correct in the edit box before saving and it is unexpectedly created after posting the question.)
But, from now on, I don’t name the sheets that way.
Attached Images
File Type: png sheetname.PNG (17.2 KB, 5 views)
Reply With Quote
  #6  
Old 10-17-2023, 08:52 PM
Logit Logit is offline Error when moving (copying) a excel sheet to another workbook. Windows 10 Error when moving (copying) a excel sheet to another workbook. Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

I don't see anything else in your code that raises a red flag. At least not for me.

You could try repairing your installation of Excel or you could re-install the software.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
One veryhidden sheet, one hidden sheet and two visible sheets - how to saveas into .xlsm workbook kiwimtnbkr Excel Programming 4 06-26-2019 11:30 AM
Error when moving (copying) a excel sheet to another workbook. Copying a Sheet in a Workbook to Another with Destination-Need Values Instead of Formulas rsrasc Excel Programming 4 08-19-2018 04:00 PM
Error when moving (copying) a excel sheet to another workbook. Can a Data Source be one sheet in a multi-sheet Workbook nfotx Mail Merge 1 07-01-2015 12:55 AM
Error when moving (copying) a excel sheet to another workbook. Browse to a specific sheet in an excel workbook Sinister Excel 4 04-08-2014 05:53 PM
Range(Cell1,Cell2) Error on another workbook controlling some other workbook? tinfanide Excel Programming 1 02-09-2012 04:08 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft