944,039 Members | Top Members by Rank

Ad:
Mar 23rd, 2007
0

update excel file from vb

Expand Post »
hello,

i have to open excel file from vb application. i want to update excel file from vb if i modify some value from vb application. but i dont want msg from excel that "Do you want to save changes in this file?"

please guide me

Thnaks n Regards
from
Pranav Varma
Similar Threads
Reputation Points: 8
Solved Threads: 0
Light Poster
pranavdv is offline Offline
26 posts
since Mar 2007
Mar 24th, 2007
0

Re: update excel file from vb

Public xlApp As New Excel.Application
Public xlBook As Excel.Workbook
Public xlSheet As Excel.Worksheet
xlApp.Workbooks.OpenText FileName:= "Text.xls"
cells(1,1)= "Test2"
ActiveWorkbook.Close savechanges:=True xlApp.Quit
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Kees Baltus is offline Offline
16 posts
since Mar 2007
Mar 24th, 2007
0

Re: update excel file from vb

Click to Expand / Collapse  Quote originally posted by pranavdv ...
hello,

i have to open excel file from vb application. i want to update excel file from vb if i modify some value from vb application. but i dont want msg from excel that "Do you want to save changes in this file?"

please guide me

Thnaks n Regards
from
Pranav Varma
[quote=Kees Baltus;333963]Public xlApp As New Excel.Application
Public xlBook As Excel.Workbook
Public xlSheet As Excel.Worksheet
xlApp.Workbooks.OpenText FileName:= "Text.xls"
cells(1,1)= "Test2"
ActiveWorkbook.Close savechanges:=True xlApp.Quit
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Kees Baltus is offline Offline
16 posts
since Mar 2007
Mar 26th, 2007
0

Re: update excel file from vb

[quote=Kees Baltus;333965]
Public xlApp As New Excel.Application
Public xlBook As Excel.Workbook
Public xlSheet As Excel.Worksheet
xlApp.Workbooks.OpenText FileName:= "Text.xls"
cells(1,1)= "Test2"
ActiveWorkbook.Close savechanges:=True xlApp.Quit
Thnx for this code. This one is really upto the mark.
but still i face one problem in the last line
i.e.

ActiveWorkbook.Close savechanges = true
when i m trying above line, then no changes made in that file
but
ActiveWorkbook.Close savechanges
whn i m trying above line, then changes made, but the msg display that do u want to save changes to this file??

i dont want msg. directly it has to save the file.
if possible, please guid me.

again thanks for this help.
Reputation Points: 8
Solved Threads: 0
Light Poster
pranavdv is offline Offline
26 posts
since Mar 2007
Mar 26th, 2007
0

Re: update excel file from vb

[quote=pranavdv;334543]

Thnx for this code. This one is really upto the mark.
but still i face one problem in the last line
i.e.

ActiveWorkbook.Close savechanges = true
when i m trying above line, then no changes made in that file
but
ActiveWorkbook.Close savechanges
whn i m trying above line, then changes made, but the msg display that do u want to save changes to this file??

i dont want msg. directly it has to save the file.
if possible, please guid me.

again thanks for this help.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Kees Baltus is offline Offline
16 posts
since Mar 2007
Mar 26th, 2007
0

Re: update excel file from vb

Replace "ActiveWorkbook.Close savechanges = true "

by
"ActiveWorkbook.save
ActiveWorkbook.Close savechanges:=False"
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Kees Baltus is offline Offline
16 posts
since Mar 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Running a scan
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Very Urgent





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC