Excel as a subroutine??

DChambers

Active Member
Joined
May 19, 2006
Messages
257
Does anyone know of a way to send a string to excel from another program and have excel search for the string and return the Cell location (perhaps in the clipboard)?
By the way I cannot open excel each time - this program will be calling it on the average every 30 to 45 seconds.

Thanks
DChambers
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi DChambers,

It is quite easy to do the string search from another program if that program supports automation. All the Office applications (Word, Access, Project, PowerPoints, etc.) do support automation, and almost all other major business applications do as well, and so do virtually all the development languages--in case you wrote this program yourself. I recommend you look at the topic "Understanding Automation" in the VBA helps. The cell location would not need to be passed in the clipboard but could be returned directly to the calling program via a variable assignment. If you program supports automation, let us know what program or application it is and where the search string comes from and we could possibly provide some code.

Regarding opening Excel each time, your code will need to open it at least once and then leave it open for subsequent searches.

All this assumes the Excel file is an Excel binary file, e.g., .xls, .xlw. If it is a .csv or .txt (i.e., text) file then it is possible to read the file, do the search and identify the cell location without having to open the file in Excel.

Damon
 
Upvote 0
Damon
Thanks for the information, I did not know about Automation and am looking forward to learning about it over the weekend.
Darrell
 
Upvote 0

Forum statistics

Threads
1,225,769
Messages
6,186,929
Members
453,389
Latest member
xmkv2000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top