Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code Question

I am not very knowledgeable about VBA code so here is my
question. I am trying to update an Excel file from a
command button. I am using the following code:
Set objXL = CreateObject("Excel.Application")
objXL.Visible = True
objXL.Workbooks.Open ("file")

The spreadsheet asks me if I want to update. I would
like to respond "yes", then save and exit the file all
without clicking a button. How would I finish this code?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Code Question

Mikk

Try

Set objxl = CreateObject("Excel.Application")
objxl.Visible = True
objxl.Workbooks.Open FileName:="file", updatelinks:=True 'open file and update the links
objxl.Workbooks("aab.xls").Close savechanges:=True 'save the updated file
objxl.Application.Quit 'close the excel application


Tony

----- Mikk wrote: -----

I am not very knowledgeable about VBA code so here is my
question. I am trying to update an Excel file from a
command button. I am using the following code:
Set objXL = CreateObject("Excel.Application")
objXL.Visible = True
objXL.Workbooks.Open ("file")

The spreadsheet asks me if I want to update. I would
like to respond "yes", then save and exit the file all
without clicking a button. How would I finish this code?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code question Damian Excel Discussion (Misc queries) 1 September 25th 09 09:54 PM
VBA code question peyman Excel Discussion (Misc queries) 5 February 5th 09 12:04 AM
code question Shu of AZ Excel Discussion (Misc queries) 2 July 12th 08 01:10 AM
vb code question Stan Excel Discussion (Misc queries) 8 April 25th 08 10:43 PM
VB Code Question Stan Excel Discussion (Misc queries) 2 May 2nd 07 10:13 PM


All times are GMT +1. The time now is 07:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"