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: 2
Default Difficulties with SaveAs method

Help please.

I'm attempting to automate a File/SaveAs process with a password. The Excel
document is created by a DataJunction/Pervasive conversion. I've
incorporated other Excel formatting and save functions post-conversion
without issue, but have run into a roadblock with the SaveAs method. I've
tried the following code (and many variations thereof), and encounter one of
two errors.

Sample obtained (and modified slightly to meet DataJunction syntax
requirements) from Microsoft
TechNet(http://www.microsoft.com/technet/scr...5/hey0207.mspx)

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.DisplayAlerts = FALSE

Set objWorkbook = objExcel.Workbooks.Add
Set objWorksheet = objWorkbook.Worksheets(1)

objWorksheet.Cells(1, 1).Value = Now()
objWorkbook.SaveAs "C:\Test.xls","" ,"%reTG54w"
objExcel.Quit

If I try this exactly as it is, I receive the following:

Runtime error 124: Property or method failed (Microsoft Excel: Unable to get
the SaveAs property of the Workbook class)

With other variations, I've been able to save the document, but it receives
a new name (i.e. "c:\test.xls, %reTG54w.xls"), where it imbeds the value of
the password parameter into the filename. Any ideas? Thanks in advance.
 
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
Problem using SaveAs method Sujata Excel Discussion (Misc queries) 4 March 30th 10 07:21 AM
SaveAs method error Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 3 October 6th 09 09:05 PM
Error on ActiveWorkbook.SaveAs method Tim Zych[_8_] Excel Programming 0 May 17th 04 06:33 AM
Question Using SaveAs Method R3df1sh Excel Programming 1 November 12th 03 07:26 PM
SaveAs method L Buchy Excel Programming 1 July 11th 03 11:27 PM


All times are GMT +1. The time now is 02:20 AM.

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"