P
Przemek
Hi,
In my addin I'm opening file through workbooks.open. Till now it's
allright. But when I want to pass workbook to other subs I'm receiving
error "subscript out of range". Here is my code:
#addin
Sub RaportPlat()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogOpen)
With fd
.Filters.Add "Raport p³atno¶ci", "*.xls", 1
.Show
End With
Workbooks.Open Filename:=fd.SelectedItems(1)
Copy_Rows_Wejscie_Nieuslugi (fd.SelectedItems(1))
passing workbook to sub:
Sub Copy_Rows_Wejscie_Nieuslugi(WorkbookName As String)
'workbooks(WorkbookName).Activate
Dim RngCol As Range
Dim i As Range
Workbooks(WorkbookName).Worksheets("wejscie nieuslugi") = ActiveSheet
here i'm receiving error.
How can I resolve it, please?
TIA
Przemek
In my addin I'm opening file through workbooks.open. Till now it's
allright. But when I want to pass workbook to other subs I'm receiving
error "subscript out of range". Here is my code:
#addin
Sub RaportPlat()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogOpen)
With fd
.Filters.Add "Raport p³atno¶ci", "*.xls", 1
.Show
End With
Workbooks.Open Filename:=fd.SelectedItems(1)
Copy_Rows_Wejscie_Nieuslugi (fd.SelectedItems(1))
passing workbook to sub:
Sub Copy_Rows_Wejscie_Nieuslugi(WorkbookName As String)
'workbooks(WorkbookName).Activate
Dim RngCol As Range
Dim i As Range
Workbooks(WorkbookName).Worksheets("wejscie nieuslugi") = ActiveSheet
here i'm receiving error.
How can I resolve it, please?
TIA
Przemek