Use Office spreadsheet component in a ActiveX dll

K

KJTFS

At least the time is down a little. Your users will have to realiz
that some things take time, even the most efficient process in
computer takes time!!! Until we reach the point of Quantum Computer
(I don't know when or if that will happen) operations will take time.
I hate users that say this should be instant. NO do it out by hand an
tell me if it is instant, last time I checked the space time contiuniu
was still intact. Unless you are doing something that needs to be don
in Real Time like something in a hospital or such then the user shoul
be able to wait 10-20s unless they want to take a pay cut and support
1000 opteron server running 1TB or ram!!!! I remember working o
computers that didn't break the 100Mhz barrier, now that was slow bu
you dealt with it as it was the fastest way. I am sure you could mak
your process more efficient but you will have to use some dat
structures, I am not sure how much you know about linked lists an
trees.... But that is an option. I would just remind your users tha
computers are still doing something even though they think they ar
magic boxes that sit on their desk. I work at a financial company an
I get so many users that want things to be instant well a SQL query o
500000 rows is going to take a while, then I usually tell them to do i
by hand, O that would take days and days to do, OK so it takes th
computer 20s what is the problem. Usually they are quite after that!!
(All this is said with the idea that you are programming efficientl
and not putting a lot of overhead into your programs)


Sorry that was my little rant.
Keith
www.kjtfs.com
 
K

KJTFS

And BTW I create everything I do on my Overclocked computer running at
3.7Ghz with 1GB of ram and a RAID 0 drive setup, so I am a speed freak
but I still test everything on a 700Mhz with 128MB of ram and a 5200RPM
drive.

Keith
www.kjtfs.com
 
O

ofergo

Hi,
Do you know if it is possible to open an excel file into the
spreadsheet component? How can I do it?

Thanks,
Ofer.
 
K

KJTFS

ofergo said:
*Hi,
Do you know if it is possible to open an excel file into th
spreadsheet component? How can I do it?

Thanks,
Ofer. *

Yes it is, modify some of the code above to have
objXL.open "filepath"
and dont put
objXL.add

Keith
www.kjtfs.co
 
O

ofergo

I tried this simple code in MS Access 2002 and got an error:

Dim objXL As Object
Dim WkSheet As Object

Set objXL = CreateObject("OWC10.Spreadsheet.10")
objXL.Open "C:\temp\test1.xls"

Object doesn't support this property or method (Error 438)

Any idea?

Thanks,
Ofer
 
K

KJTFS

Dim ObjXL As Object
Dim ObjXLBook As Object

Set ObjXL = CreateObject("Excel.Application")
Set ObjXLBook = ObjXL.Workbooks.Open("C:\New Microsoft Excel
Worksheet.xls")

ObjXL.Application.Visible = True

Set ObjXL = Nothing
Set ObjXLBook = Nothing


Use that method as I posted earlier in the tread.

Keith
www.kjtfs.com
 
O

ofergo

Thanks.
For processing an excel file that is good. But if I would like to
present the Excel spreadsheet in Access form I need to open the file in
the component object. If this is not possible, do you have any
alternative?
 
K

KJTFS

Well I have been looking thru a book I have and they have a sectio
devoted to Loading data. Here is a direct quote.
"Since the spreadsheet component is not an application, the question
"Where does it get data from?" and "How can I save data?" are crucial.
Yet the answers to these questions are much more complicated than the
would be for an application." They say there are 4 methods to get dat
into the spreadsheet control.

Publish a spreadsheet or range from excel 2000 with interactivity.

Copy a range from excel and paste it into the spreadsheet control.

Type data or a new set of formulas intot he spreadsheet, while i
design mode.

Load data from web page.

I would go with the copy a range from excel and paste it. You might b
able to do something sexier though. BTW the book is "Programming M
Office 2000 Web Components" by Microsoft Press. So maybe XP or 200
added some new functionality but I doubt it. Hope that helps.

Keith
www.kjtfs.co
 
O

ofergo

Hi,
Thanks a lot. I would like to tell you that I searched the Web, helps
and tried for almost 10 days to find the way to upload data.

Now I know the answer. Thanks again.
Ofer.
 
K

KJTFS

Your welcome and if you do find a method please post it, I am only goin
by what the book said, and I have seen books be wrong...... Hope yo
find some workaround.

Keith
www.kjtfs.co
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top