Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Access 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2003 VBA Programmer's Reference by Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein; ISBN: 9780764559037
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2003 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2006, 07:08 AM
Authorized User
 
Join Date: Dec 2005
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBA writing an excel file

Hi everyone,

I curious about the excel writing codes from microsoft site (see below - I added the temp folder bit).The code asks for the "saveas" to exist for the code to work. I just want to create an excel file with some data inside it and let the user decide whether to save the file or not. if the file is saved by default I need to delete the file every time the code is run. Could anyone tell me how to write an excel file (from onclick event) and not need to save it?

Code:
    Set FS = CreateObject("Scripting.FileSystemObject")
    'Debug.Print FS.GetSpecialFolder(2)

    Set Excel = CreateObject("Excel.Sheet")
    Excel.Application.Visible = True
    Excel.Application.Cells(1, 1).Value = "test"
    Excel.SaveAs FS.GetSpecialFolder(2) & "\SumExcelOutput.xls"
    Excel.Application.Quit
    Set Excel = Nothing




Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening an excel file with VBA TwEaKFrEaK Excel VBA 6 May 23rd, 2014 12:08 PM
MS Excel - File Links - VBA a_barnsley Excel VBA 1 July 23rd, 2007 10:48 AM
Saving an excel file in Access VBA theboylatham Access VBA 1 August 19th, 2005 08:14 AM
Run .bat file from Excel VBA Harold Hawken Excel VBA 2 June 23rd, 2005 03:03 PM
writing excel file in C doomurful C# 0 July 12th, 2004 08:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.