I am using the following VBA commands, however it is opening up a new work excel work book. I would like it to be added to a new sheet in my current workbook. Any help would be appreciated.
ChDir "..path.."
Workbooks.OpenText Filename:="...path"
I am using the following VBA commands, however it is opening up a new work excel work book. I would like it to be added to a new sheet in my current workbook. Any help would be appreciated.
ChDir "..path.."
Workbooks.OpenText Filename:="...path"
![]()
Sub addsheet() ActiveWorkbook.Sheets.Add after:=Worksheets(Worksheets.Count) ActiveSheet.Name = "John" End Sub
If solved remember to mark Thread as solved
This worked perfect on some, however I have been recently getting this error:
"Excel cannot insert the sheets into the destination workbook, because it contains fewer rows and columns than the source workbook. To move or copy the data to the destination workbook, you can select the data, and then use the copy and paste commands to insert it into the sheets of another workbook".
Is there anyway around this?
![]()
Dim wbOpen As Workbook, wksNew As Worksheet, strWbk As String strWbk = "C:\path\Test.xls" Set wbOpen = Workbooks.Open(strWbk) wbOpen.Sheets(1).Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
Saving the input file as a Excel 97-2003 file seems to do the trick.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks