Error on Save As

G

Guest

Hi This is driving me nuts!
I am working on a file I want to save as an xlt, and once the user has
entered all the data on the form I want them to click a button that will
result in the file being printed, saved, emailed and closed. print & email
sorted, but saving is giving me grief!
I looked at other posts, and I copied some neat code to get up a chose
folder dialog box, and then I add the file name (from a couple of cells) and
currently use:
ThisWorkbook.SaveAs Filename:=path & "\" & client
Excel then crashes and closes.
Run Time Error '2147417848(80010108)'
Automation Error The Object has disconected from its client

Please what am I doing wrong!
TIA
Graham Y
 
G

Guest

Graham - perhaps something is wrong with your path/client variables?
I tried this and it works for me:

Sub zzz()
Dim path As String, client As String
path = "c:\temp"
client = "z.xls"
ThisWorkbook.SaveAs Filename:=path & "\" & client
End Sub

try seeing what your Filename variable is - enter this before your SaveAs
line:
msgbox path & "\" & client
this will visually show you what you are passing to the SaveAs object -
perhaps it's not quite what you think it is.
 
G

Guest

It appears that there is a bug in VBA. I looked up the error code and it
suggests it has to do with late binding, in VB projects, and it looks as if
this is a related problem, even without doing the save as just using a
msgbox, when I quit the app I cannot get to another module or form by double
clicking it in the VBA IDE.
I've tried to install updates but it's asking for my Office disk, which I
can't find! I'll have to keep hunting, or do this at work not home!

But thanks for the suggestion.
 

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

Similar Threads


Top