User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 392,090 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,939 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 2286 | Replies: 7
Reply
Join Date: Jul 2006
Posts: 13
Reputation: deep_3657 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
deep_3657 deep_3657 is offline Offline
Newbie Poster

How to access and modify values of a OLE object(Excel Worksheet)

  #1  
Jun 16th, 2007
Hello,

I want to know is it possible to access and modify content of a Excel worksheet dynamically inserted as OLE object in a form. I wish to check and update values of various cells by cell number of the worksheet, but not being sure if possible.

thanks in advance
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2007
Posts: 166
Reputation: AV Manoharan is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 7
AV Manoharan AV Manoharan is offline Offline
Junior Poster

Re: How to access and modify values of a OLE object(Excel Worksheet)

  #2  
Jun 18th, 2007
Why don't you try it?

There is nothing impossible when you get the connection and permission.
Reply With Quote  
Join Date: Jul 2006
Posts: 13
Reputation: deep_3657 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
deep_3657 deep_3657 is offline Offline
Newbie Poster

Re: How to access and modify values of a OLE object(Excel Worksheet)

  #3  
Jun 18th, 2007
Originally Posted by AV Manoharan View Post
Why don't you try it?

There is nothing impossible when you get the connection and permission.


Yes I want to use it, but have no idea about how to go about it
Reply With Quote  
Join Date: Nov 2006
Posts: 695
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 95
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Master Poster

Re: How to access and modify values of a OLE object(Excel Worksheet)

  #4  
Jun 18th, 2007
Hi Deep,

U r opening Excel using "Excel Object " or by Opening in "OLE Control"...?

I have the code if u r opening with
Excel Object.

Regards
Veena
Reply With Quote  
Join Date: Jul 2006
Posts: 13
Reputation: deep_3657 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
deep_3657 deep_3657 is offline Offline
Newbie Poster

Re: How to access and modify values of a OLE object(Excel Worksheet)

  #5  
Jun 18th, 2007
Originally Posted by QVeen72 View Post
Hi Deep,

U r opening Excel using "Excel Object " or by Opening in "OLE Control"...?

I have the code if u r opening with
Excel Object.

Regards
Veena



I have embedded excel as a OLE object
Reply With Quote  
Join Date: Jun 2007
Posts: 166
Reputation: AV Manoharan is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 7
AV Manoharan AV Manoharan is offline Offline
Junior Poster

Re: How to access and modify values of a OLE object(Excel Worksheet)

  #6  
Jun 18th, 2007
Originally Posted by deep_3657 View Post
I have embedded excel as a OLE object


See, I requested you to try.

See when you have the connection as an OLE object its behaviour is just like a table of the database. Each sheet corresponding to one table and within each sheet the columns represent table fields.

the record set object works fine here also.

Try and let me know your progress.
Reply With Quote  
Join Date: Jul 2006
Posts: 13
Reputation: deep_3657 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
deep_3657 deep_3657 is offline Offline
Newbie Poster

Re: How to access and modify values of a OLE object(Excel Worksheet)

  #7  
Jun 18th, 2007
But the excel documents I am working with are not the set of records like we have in database.

I am working with excel files which are soft copies of various physical documents like invoice, quotations etc. Programitically I would say various informations are scattered all around.

However Cell Number where a specific information is found is always fixed. This is the reason i wish to access is by cell numbers rather than by database approach.
Reply With Quote  
Join Date: Jun 2007
Posts: 166
Reputation: AV Manoharan is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 7
AV Manoharan AV Manoharan is offline Offline
Junior Poster

Re: How to access and modify values of a OLE object(Excel Worksheet)

  #8  
Jun 19th, 2007
Originally Posted by deep_3657 View Post
But the excel documents I am working with are not the set of records like we have in database.

I am working with excel files which are soft copies of various physical documents like invoice, quotations etc. Programitically I would say various informations are scattered all around.

However Cell Number where a specific information is found is always fixed. This is the reason i wish to access is by cell numbers rather than by database approach.


Then I suggest, the recordset is to be populated by two indexes to draw row as well as coulums.

That is, suppose your recordset is in the second record, then the raw corresponds to the cursor location second among the records.

Then you have to access columns right with the recordsetname.Fields(index)-which is your columns in excel in that row

recordsetname.MoveNext increases the row count to one
and again your column index has to reinitialise else it will be out of your excel columns.

Now, you got it I hope.
Get back to the thread

regards
AV Manoharan
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 12:37 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC