Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Studio Error Code -2146827284 SaveAs to Excel

Status
Not open for further replies.

PWD

Technical User
Jul 12, 2002
823
GB
Good afternoon, I'm not sure if this is the correct place or not to pose this question.
I have inherited a Visual Studio project from a colleague who has left the company. Part of it involves saving a file. When I get to here:-
Code:
.ActiveWorkbook.SaveAs(Filename:=strGPath & strBook(j) & "\" & strLogin & "_" & strRename(j) & ".xls", FileFormat:=Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal, Password _
:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:= _
False)
I get
COMException was unhandled
Exception from HRESULT: 0x800A03EC

I've not changed anything on the script; the only thing that may be different is that I had to choose a scripting language when I ran Visual Studio for the first time & I chose 'General'.

The 'Call Stack' is this:-

> j246809_excel.exe!j246809_excel.Form1.Form1_Load(Object sender = {j246809_excel.Form1}, System.EventArgs e = {System.EventArgs}) Line 195 Basic

I am running MS Office Professional Plus 2010.

Many thanks,
D€$
 
hi,

Whay are you saving as an .xls (Excel 97-2003 format)????

Is this VB.net code? forum796.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hi Skip, this is just how it was. I'm more than happy to save as xlsx or any other format, I just need to get the code working to create these output files.

This is in Visual Studio - hence my uncertainty where to post.

Many thanks,
D€$
 
Doofus me!!!!

Code:
 strBook(j)
were sub-folders that didn't exist. Nice error messaging though - NOT.

Many thanks,
D€$
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top