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: 124
Default Hlep with code referencing an addin file.

Hi,
I'm using the following code to add 4 worksheets from another worksheet to
the active workbook.
It works great..unitl I change the Workbook name to the addin file name of
"WCAddin.xla"...which is how I need to run that file.
I get a Run Time Error --Application- defined or object defined error
message.
Is this due to me changing the workbook file name to xla vs xls?
If yes.. how would I rewrite the code to work with the addin file instead?


Public Sub AddWStoWCTemplate()

Workbooks("WCAddin.xls").Sheets(Array("Summary", "Adjustments", "Details",
"Calculations")).Copy After:=ActiveWorkbook.Worksheets(Worksheets.Count)

With ActiveWorkbook
For i = .Worksheets.Count To .Worksheets.Count - 3 Step -1
With Worksheets(i)
.Range("A1").Formula = .Range("A1").Value
.Range("A2").Formula = .Range("A2").Value
.Range("A3").Formula = .Range("A3").Value
End With
Next
End With

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
lookup function, I need hlep Northo111 Excel Worksheet Functions 4 January 15th 08 05:44 PM
using code from an addin alfaista[_2_] Excel Programming 4 April 27th 04 03:36 PM
Accessing Addin from Sheet_Event Code zSplash Excel Programming 3 December 7th 03 09:52 PM
Accessing Addin from Sheet_Event Code zSplash Excel Programming 0 December 7th 03 05:35 PM
using a function in an addin in my vba code archangel Excel Programming 2 September 6th 03 08:09 AM


All times are GMT +1. The time now is 07:21 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"