update excel file from vb

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Mar 2007
Posts: 24
Reputation: pranavdv is an unknown quantity at this point 
Solved Threads: 0
pranavdv pranavdv is offline Offline
Newbie Poster

update excel file from vb

 
0
  #1
Mar 23rd, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 16
Reputation: Kees Baltus is an unknown quantity at this point 
Solved Threads: 0
Kees Baltus Kees Baltus is offline Offline
Newbie Poster

Re: update excel file from vb

 
0
  #2
Mar 24th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 16
Reputation: Kees Baltus is an unknown quantity at this point 
Solved Threads: 0
Kees Baltus Kees Baltus is offline Offline
Newbie Poster

Re: update excel file from vb

 
0
  #3
Mar 24th, 2007
Originally Posted by pranavdv View 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
[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
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 24
Reputation: pranavdv is an unknown quantity at this point 
Solved Threads: 0
pranavdv pranavdv is offline Offline
Newbie Poster

Re: update excel file from vb

 
0
  #4
Mar 26th, 2007
[quote=Kees Baltus;333965]
Originally Posted by Kees Baltus View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 16
Reputation: Kees Baltus is an unknown quantity at this point 
Solved Threads: 0
Kees Baltus Kees Baltus is offline Offline
Newbie Poster

Re: update excel file from vb

 
0
  #5
Mar 26th, 2007
[quote=pranavdv;334543]
Originally Posted by Kees Baltus View Post

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.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 16
Reputation: Kees Baltus is an unknown quantity at this point 
Solved Threads: 0
Kees Baltus Kees Baltus is offline Offline
Newbie Poster

Re: update excel file from vb

 
0
  #6
Mar 26th, 2007
Replace "ActiveWorkbook.Close savechanges = true "

by
"ActiveWorkbook.save
ActiveWorkbook.Close savechanges:=False"
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 7753 | Replies: 5
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC