473,387 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Open a Excel File from Word

Hello All,

How can a excel file is open from ms word through a code ? Kindly advised.

Thanks
Feb 12 '08 #1
5 1310
kadghar
1,295 Expert 1GB
Hello All,

How can a excel file is open from ms word through a code ? Kindly advised.

Thanks
This question has already been answered in other threads, anyway:

Expand|Select|Wrap|Line Numbers
  1. dim obj1 as object
  2. set obj1 = createobject("excel.application")
  3. obj1.visible=true
  4. obj1.wokbooks.open("c:\mybook.xls")
will do.
Remember that if you use some macro recorded with excel in your word's VBA, the xl constants wont work. search in the object browser (F2) or while debuging the code for its numeric value.

HTH
Feb 12 '08 #2
werks
220 100+
Hello All,

How can a excel file is open from ms word through a code ? Kindly advised.

Thanks
I'm a bit confused with your question nkg6971. Correct me if I'm wrong but you want an Excel file be open using MS Word codes???
Feb 12 '08 #3
kadghar
1,295 Expert 1GB
I'm a bit confused with your question nkg6971. Correct me if I'm wrong but you want an Excel file be open using MS Word codes???
well that's a good question, and some clarification might be needed...

but since this is a VB forum, i'll assume it's a VBA question.
Feb 12 '08 #4
werks
220 100+
Please post your feedback nkg6971 so we can help you..

--
Kenneth
"Better Than Yesterday"
Feb 12 '08 #5
well that's a good question, and some clarification might be needed...

but since this is a VB forum, i'll assume it's a VBA question.


Thanks Kadghar, I have got the solution as the code given by you.
Feb 13 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jenni | last post by:
Hi, A quick question. I have been battling with this code all morning, please help. Here is the code Dim fPath1 As String Dim fPath2 As String fPath1 = "C:\Program Files\Microsoft...
0
by: Steve Chatham | last post by:
I am stuck on this. It ought to be a simple reason as to why this is problematic, in that it works on smaller groups of data (say under 40 records), but doesn't on larger groups of records (40+)....
4
by: Simon Cheng | last post by:
Hi, How do I open a Word or Excel document inside an event handler (e.g., Page_Load())? Thanks, Simon
1
by: Seok Bee | last post by:
Dear Experts, I'm trying to open a file from my web form. However, when I click on the button, no action is being performed. I have tried running it in debugging mode, the file is able to open....
8
by: Radu | last post by:
Hi, I have the following problem: I open a recordset based on excel/csv files, but then I need to filter (in code) in order to extract only data pertaining to a specific person. This code is...
0
by: Vader | last post by:
I am new to this forum. Thanks in advance for and help. The following is what I am looking for: 1. I need help with VB code to open a MS Word (.doc) file. 2. Read lines from the MS Word (.doc)...
1
hidash
by: hidash | last post by:
hi everyone, i need some help in opening excel and word file using poi filesystem. i have created a new word and excel file using poi. but i am struggling to open the existing file using poi. pls...
7
by: Peter | last post by:
ASP.NET 2.0 I am trying to open a Word document and Excel document from a dialog web page, what's the best way to do that? I have tried the following: Response.Clear();...
7
by: Peter | last post by:
I have the following code which is executed from a modal web page - it works fine on most, but on some computers the Word loads into memory but never displays. This occurs with IE6 and IE7, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.