Jump to content

VBA SaveAS Run-time error '-2145320861...


Recommended Posts

I have the following code:




xtNumPed = Format(txtNumPed, "00000#")

sNP = Right(txtNumPed, 6) 'os seis últimos d�*gitos do nº do pedido

dHr = Format(Hour(Now), "0#") 'hora

dMn = Format(Minute(Now), "0#") 'minuto

dSc = Format(Second(Now), "0#") 'segundo

txtNDES = "RED" & "-" & sNP & "-" & dHr & dMn & "-" & dSc

sNDes = txtNDES 'nº do desenho


Dim SavePath As String

Dim SaveName As String

SavePath = "\\main\trabalho\autocad\automation\"

SaveName = SavePath & sNDes & ".dwg"


ThisDrawing.SaveAs SaveName, acNative



"Run-time error '-2145320861 (80210063)': Error saving the document"


I'd like to receive information about this error.



Link to comment
Share on other sites

  • 2 weeks later...

I am having the exact same problem.

Could you say which AutoCAD version you are using, and what the OS is?

I'm using 2005, and Windows Server 2003.

Link to comment
Share on other sites

  • 3 years later...

Has this issue been resolved yet? I am having identical problems to what is being reported here and have found no help at all.


I am automating AutoCAD 2012 via scripting from VB6. I am currently using AutoCAD 2012 on an up to date Windows XP machine that is running as a Virtual Machine.


If I just run straight through, this code fails quite often. If I stop in the d e b u g g e r and slowly single step through the sub that the code is in, it will usually do what is needed. If it does fail while single stepping and I resume next and then set the line that does the SaveAs as the current line of execution and retry it, it works most of the time. This seems to be some kind of timing issue or something but for the life of me, I can't come up with an answer.


I also get the following useless dialog box a lot when these issues come up. As you can plainly see, this error dialog is of absolutely no use at all.


If any of you have come up with an answer or work-around for this, I would really appreciate a reply here or an email.


Thank you in advance for any help on this issue.




Goofy Dialog Box..JPG

Edited by PatrickMoe
modify censored word
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...