Re: open excel worksheet

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: joy (anonymous_at_discussions.microsoft.com)
Date: 02/03/04


Date: Mon, 2 Feb 2004 23:21:01 -0800

Chris, thank you for answering, but still,
I have changed my code a little (erased the lines:
>> xlBook1.Application.Visible = True
>> xlBook1.Parent.Windows(1).Visible = True
)
and the exact line are these:

 Set xlApp = CreateObject("excel.application")
 strRepFileName = App.Path & "\xlPatReports.XLS"
 xlApp.Visible = True
 xlApp.Workbooks.Open strRepFileName, UpdateLinks:=3,_
 ReadOnly:=False

well, I can't see the file xlPatReport from either the vb
app(before destroying the object) nor from excel(after
saving and destroying the object),
all i can see, in both cases is Excel applicatin launched,
with black ***(when open it from my vb app) or Book1
*** when open the file from Excel directly.
a riddle.
Please need your help urgent
joy

 
>-----Original Message-----
>Are you doing this from VB or VBA (inside of the Excel
application)
>
>This code is the most basic connection to Excel from VB;
>'Create the Excel Object
>Dim ObjExcel As excel.Application
>Set ObjExcel = New excel.Application
>
>'Use to show or hide excel from the users view
>ObjExcel.Visible = True
>
>'Open a specific file
>
>'Update Link Types
>'0 - None
>'1 - External Only
>'2 - Remote Only
>'3 - All
>
>ObjExcel.Workbooks.Open "C:\MyWorkbook.xls",
UpdateLinks:=3, _
> ReadOnly:=False
>
>'Set to a specific *** - Not required
>ObjExcel.Sheets("Sheet1").Select
>
>'**********************************
>'Perform Actions against Excel here
>'**********************************
>
>'Quit Word
>ObjExcel.Quit
>
>'Destroy the object
>Set ObjExcel = Nothing
>
>--
>Chris Hanscom
>MVP (Visual Basic)
>http://www.veign.com
>Application Design Section
>http://www.veign.com/information/application/info_app.html
>------
>"joy" <anonymous@discussions.microsoft.com> wrote in
message
>news:877a01c3e99b$d945aa50$a001280a@phx.gbl...
>> my vb app uses excel application, and writes data to a
>> work***. although i save this workbook , i can not
>> reopen it. (it exsits, it weights, but can't be open).
>> the lines in code:
>> xlBook1.Application.Visible = True
>> xlBook1.Parent.Windows(1).Visible = True
>> do show the excel file as needed, but then an error
occur
>> and the excel application close.
>> i need to open the excel file outside the vb app. so it
>> will be accesible for all
>> need that help urgently
>> joy
>
>
>.
>


Quantcast