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

Trying to set default value for Save as directory

4 views
Skip to first unread message

Mattm

unread,
Feb 16, 2011, 1:38:36 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

0 new messages