Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error on Save As
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error on Save As
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. "Graham Y" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error on Save As
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. "Dion" wrote: 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. "Graham Y" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
CSV error when trying to save | Excel Discussion (Misc queries) | |||
Save As Error | Excel Discussion (Misc queries) | |||
Subscript out of range error - save copy error | Excel Programming | |||
Subscript out of range error - save copy error | Excel Programming | |||
Excel Save Error | Excel Discussion (Misc queries) |