Solved

Embedding Excel 97 spreadsheets

Posted on 1998-06-01
1
145 Views
Last Modified: 2010-05-03
I am embedding an Excel 97 worksheet into my application (setting the class as Excel.Sheet.8). When I try and set a value in a cell using the follwing line :

OLE1.object.Worksheets("Sheet1").Range("R1C1").Value = 100

I get run-time error '1004'. If I use the A1 reference style it works but unfortunately I need to use the R1C1 style. I've tried various themes on the above line (like taking the quotes out etc) but none of them work. Excel help is of no particular use. Please help!!!

John
0
Comment
Question by:jgill
1 Comment
 
LVL 5

Accepted Solution

by:
bin_huwairib earned 50 total points
ID: 1462179
jgill,

To use R1C1 style do the following:

OLE1.object.Worksheets("Sheet1").Range("B1").FormulaR1C1 = "100"


Best regards
Bin Huwairib
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now