RSS Forums RSS
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 4787 | Replies: 5
Reply
Join Date: Mar 2007
Posts: 22
Reputation: pranavdv is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
pranavdv pranavdv is offline Offline
Newbie Poster

update excel file from vb

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2007
Posts: 16
Reputation: Kees Baltus is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Kees Baltus Kees Baltus is offline Offline
Newbie Poster

Re: update excel file from vb

  #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  
Join Date: Mar 2007
Posts: 16
Reputation: Kees Baltus is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Kees Baltus Kees Baltus is offline Offline
Newbie Poster

Solution Re: update excel file from vb

  #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  
Join Date: Mar 2007
Posts: 22
Reputation: pranavdv is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
pranavdv pranavdv is offline Offline
Newbie Poster

Troubleshooting Re: update excel file from vb

  #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  
Join Date: Mar 2007
Posts: 16
Reputation: Kees Baltus is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Kees Baltus Kees Baltus is offline Offline
Newbie Poster

Re: update excel file from vb

  #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  
Join Date: Mar 2007
Posts: 16
Reputation: Kees Baltus is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Kees Baltus Kees Baltus is offline Offline
Newbie Poster

Re: update excel file from vb

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

by
"ActiveWorkbook.save
ActiveWorkbook.Close savechanges:=False"
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:48 am.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC