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 Chriss Miller 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 morning, I'm not sure if this is the correct place or not to pose this question. (I posted this on the VBA site yesterday but didn't get it resolved.)

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/project, it has all the same references etc.; the only thing that may be different is that because I have a new profile on her PC, 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. Haven't got a clue what to do.

Many thanks,
D€$
 


Since there is a new profile, make sure the path produced via the code actually exists on the machine and the user has write permissions.


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Hi Mark, you were pretty much spot-on.

Doofus me!!!!

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

Thanx.

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

Part and Inventory Search

Sponsor

Back
Top