|
-
Mar 9th, 2000, 12:09 AM
#1
Thread Starter
New Member
I COULD REALLY USE HELP ON THIS ONE - THANK YOU!!!
I need to access a formatted Excel form, copy it,
add some cell values and then resave it in it's new directory.
Seems simple enough..........
However, I have only managed to save either empty Excel references to the directory, or the Form's values only without any of the formatting. The code goes basically
something like this:
dim ORGBook as excel.workbook
dim HDCBook as excel.workbook
set ORGBook = getobject("c:\Docs\STP\X.xls")
ORGbook.SaveAs "c:\Output\STP\NewX.xls
set HDCBook = getobject("c:\Output\STP\NewX.xls")
'Fill certain fields
'then resave and close
The problem is with the ORGbook.saveas statement. It is saving an empty reference - NO DOCUMENT ????????
-
Mar 9th, 2000, 04:01 AM
#2
Frenzied Member
I COULD REALLY USE HELP ON THIS ONE - THANK YOU!!!
I need to access a formatted Excel form, copy it,
add some cell values and then resave it in it's new directory.
Seems simple enough..........
However, I have only managed to save either empty Excel references to the directory, or the Form's values only without any of the formatting. The code goes basically
something like this:
dim ORGBook as excel.workbook
dim HDCBook as excel.workbook
set ORGBook = getobject("c:\Docs\STP\X.xls")
ORGbook.SaveAs "c:\Output\STP\NewX.xls
set HDCBook = getobject("c:\Output\STP\NewX.xls")
'Fill certain fields
'then resave and close
The problem is with the ORGbook.saveas statement. It is saving an empty reference - NO DOCUMENT ????????
I generally open an instance of Excel:
Code:
dim MyXL as Excel.Application
set MyXL = New Excel.Application
Then I'd do the rest
Code:
Dim ORGBook as Excel.Workbook
Dim HDCBook as Excel.Workbook
set ORGBook = MyXL.Workbooks.Open("c:\Docs\STP\X.xls")
MyXL.ORGbook.SaveAs "c:\Output\STP\NewX.xls"
set HDCBook = MyXL.Workbooks.Open("c:\Output\STP\NewX.xls")
'Fill certain fields
'then resave and close
MyXL.HDCbook.Close SaveChanges:=True
MyXL.Quit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|