#1
|
|||
|
|||
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? |
#2
|
|||
|
|||
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. |
#3
|
|||
|
|||
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. |
#4
|
|||
|
|||
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. |
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
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. |
|
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 |
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 |
Can a Data Source be one sheet in a multi-sheet Workbook | nfotx | Mail Merge | 1 | 07-01-2015 12:55 AM |
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 |