954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

update excel file from vb

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

pranavdv
Light Poster
26 posts since Mar 2007
Reputation Points: 8
Solved Threads: 0
 

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

Kees Baltus
Newbie Poster
16 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 
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

Kees Baltus
Newbie Poster
16 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

[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.:)

pranavdv
Light Poster
26 posts since Mar 2007
Reputation Points: 8
Solved Threads: 0
 

[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.:)

Kees Baltus
Newbie Poster
16 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

Replace "ActiveWorkbook.Close savechanges = true "

by
"ActiveWorkbook.save
ActiveWorkbook.Close savechanges:=False"

Kees Baltus
Newbie Poster
16 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You