473,426 Members | 1,690 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,426 software developers and data experts.

Modify the excel sheet

198 100+
hello expert
i have a programe in which i want to modify or add new records in excel sheet
but it opened read only and when ever i want to insert the record it give the message that give new name to save the changes
is there any idea to modify the excel sheet my code is

Set x1 = CreateObject("Excel.Application")
x1.Workbooks.Open ("c:\var\var2.xls")
x1.Visible = True
x1.Worksheets(1).Cells(10, 5) = "hello"
'x1.ActiveWorkbook.Save
Set xl = Nothing
Unload Me
thanks
Nov 23 '07 #1
1 1261
Muiz
6
Hi,

may be this code will help..
first add refrence for Excel

Dim objXL As Excel.Application
Dim objWB As Excel.Workbook
Dim objWS As Excel.Worksheet
Set objXL = New Excel.Application
Set objWB = objXL.Workbooks.Open("C:\Documents and Settings\raj\Desktop\Value Card\Appreciation.xls")
Set objWS = objWB.Worksheets(1)
With objWS
.Cells(17, 6) = Combo2.Text
.Cells(20, 6) = Text1.Text
objWB.Save
objWB.Close
End With
Set objWS = Nothing
Set objWB = Nothing
Nov 27 '07 #2

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

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
12
by: elziko | last post by:
I'm using late binding (I must) to automate Excel. My code opens Excel after createing and poulating some sheets. My problem is that when the user finally decides to close Excel its process is...
3
by: | last post by:
I wrote a class in VB.NET to export the contents of a datagrid to Excel. It works perfectly on my machine, but it fails on my customers' PCs that have identical versions of Win XP (SP1) and Excel...
4
by: Marco Aschwanden | last post by:
Hi I would like to 1. import an existing Excel-sheet (a template) 2. and add some data to it 3. and save it under a different name afterwards. To me it seems, that pyExcelerator does not...
3
by: implicate_order | last post by:
Greetings, I'm new to python and am in the process of writing a script to parse some CSV data, spread it across multiple Excel worksheets and then generate charts. I searched the internet to...
5
by: tsanthoshk | last post by:
Hi All I am trying to read and modify input excel file. when i update the data in excel sheet already existing format is washing out. It mean if excel sheet contain colors those are not appearing...
2
by: shaiful | last post by:
Hi all, I have some code to open an Excel file and I can edit the Excel file easily, Dim xlapp As excel.Application Dim xlbook As excel.WorkBook Dim xlsheet As excel.WorkSheet Set xlbook =...
2
by: amuven | last post by:
Hi All, I'm new to python I have written very basic and small code and I request to help for the following senario.For my project i want to write a python code which should open an already...
2
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.