Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Trying to set default value for Save as directory

12 views
Skip to first unread message

Mattm

unread,
Feb 16, 2011, 1:43:50 PM2/16/11
to
I'm developing an VB app using VS2005 that brings up an Excel spread
sheet and populates it with data. I want the user to save it to a
particular directory. Currently I have an excel app in my code
defined as

myExcel = New Microsoft.Office.Interop.Excel.Application


That seems to work fine. I then go on to try to set the
InitialFileName property of the FileDialog using


myExcel.FileDialog(msoFileDialogSaveAs).InitialFileName = "C:
\Book1.xls"


The rest of my code seems to work fine, but when I run this line of
code, I get a run time error that says:


Unhandled exception of type
"System.Runtime.InteropServices.COMException" occured in
Microsoft.VisualBasic.dll
Additional information: The server threw an exception. (Exception
from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))


I'm not sure what I'm doing wrong. Any ideas...


MattM


Michael Cole

unread,
Feb 16, 2011, 8:37:06 PM2/16/11
to
It happens that Mattm formulated :
> I'm developing an VB app using VS2005 ...

Wrong newsgroup - this is for VB Classic - VB6 and earlier. Look for
newsgroups with dotnet in their name - try
microsoft.public.dotnet.languages.vb

--
Michael Cole


0 new messages