View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
smileclick smileclick is offline
external usenet poster
 
Posts: 3
Default How do you import sheets into an Excel XLA Add-In?

I'm trying to import worksheets from a spreadsheet file into an the running
XLA Add-In (the XLA holding the code for importing the spreadsheets).

I tried using:
Sheets(Array("Sheet1","Sheet2")).Copy After:=ThisWorkbook.Sheets(1)

But got a "Run-time error '1004': Copy Method of Worksheet Class failed" error

I tried using:
Sheets.Add Type:=Source_File_Name, befo=ThisWorkbook.Sheets(1)
But it will only add the sheets to the Active Workbook, not the XLA Workbook
(if there is no open workbook I get a "Method 'Sheets' of object '_Global'
failed" error).