Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Having a problem getting Excel to work from my .Net VB Program

This should be a simple question for those of you who do this all the time. I
have a web based report that I need to allow the user to export to Excel. I
followed all the instructions from Microsoft web based knowledge areas and
included the COM Excel 9.0 library. I issued the following code:
================================================== ==
Private xlapp as Excel.Applicaiton
Private xlsheet as Excel.Worksheet
....
xlapp = GetXLApp() '<== Error happens in this function
xlapp.Workbooks.Add()

The function GetXLApp is below:

Public Function GetXLApp() As Object
Try

GetXLApp = CreateObject("Excel.Application") ' <== Returns error
GetXLApp.Visible = True

Catch ex As Exception
lblStatus.Text = Trim(ex.ToString)
End Try
End Function

================================================== =

The error message is:
System.NullReferenceException: Object reference not set to an instance of an
object. at QueMgmtReport.Queue.Activity_Report() in
\\net-plan\wwwroot$\QueMgmtReport\Queue.aspx.vb:line 158
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
emailing excel worksheet from excel program d/n work? how to fix? karlv Excel Worksheet Functions 1 September 19th 08 04:21 PM
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene LunaMoon Excel Discussion (Misc queries) 0 July 28th 08 11:03 PM
Program for assigning work shift hours frankiee Excel Discussion (Misc queries) 1 March 10th 06 02:54 AM
What program would work better? tb Excel Discussion (Misc queries) 3 March 11th 05 06:31 AM
Program no longer work on Excel 2003 maxifire[_7_] Excel Programming 5 July 19th 04 09:09 PM


All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"