LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Excel object - save as csv from Word?

From within a Word macro I'm trying to save an Excel object as a csv file,
but can't seem to find any documentation that explains how to do it. Any
ideas? Code below -- I've tried objExcel.dialogs(xlDialogSaveAs).show but
get an error saying that xlDialogSaveAs is an undefined variable, and when I
try to specify xlCSV as a file format I get the same undefined variable error:

sub SaveAsCSV()

Dim objExcel As Object

Set objExcel = CreateObject("Excel.Application")

objExcel.Workbooks.Add

[snip - doing stuff to workbook]

objExcel.ActiveWorkbook.SaveAs FileName:="c:\myfile.csv"
'The above line saves as an .xls even if the suffix is ".csv"

objExcel.Application.Quit

Set objExcel = Nothing

end sub
 
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
excel object linked to word will not add sums in word Robin Excel Discussion (Misc queries) 0 March 31st 09 11:10 PM
PLS HELP! Excel imbedded object in Word dee Excel Discussion (Misc queries) 0 March 14th 07 01:21 PM
Print Word Object in Excel Mac Excel Discussion (Misc queries) 7 March 2nd 07 05:12 PM
TO MODIFY A EXCEL OBJECT FROM WORD USING VBA Sandra Bonilla Excel Programming 1 November 10th 04 03:59 AM
Using vb to create an excel object and save it as a CSV file eli silverman[_2_] Excel Programming 1 December 4th 03 10:15 PM


All times are GMT +1. The time now is 06:39 PM.

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

About Us

"It's about Microsoft Excel"