I have a database application which opens excel, it then reads the values of a series of cells into vba vars, before putting them into the appropriate table.
To do this i have a form using common dialog control, to browse to the appropriate file, and then off we go.
This all works fine the first time i run the event, but when i try to do it for a second file, it doesnt work.
-----------------------------------------------------
Set objExcelApp = New Excel.Application
Set objExcel = objExcelApp.Workbooks.Open(dbfile)
objExcelApp.Visible = True
For x = start_row To end_row
myVar = sheets("xyz"
.range("b" & x & ""
.Value
------------------------------------------------------
This is a snippet of the code it all goes fine the first time, but on trying it for a second file, it doesnt make it past the myVar line. Although if i shut the whole app down and restart it works fine first time but not second, regardless of which file i choose
To do this i have a form using common dialog control, to browse to the appropriate file, and then off we go.
This all works fine the first time i run the event, but when i try to do it for a second file, it doesnt work.
-----------------------------------------------------
Set objExcelApp = New Excel.Application
Set objExcel = objExcelApp.Workbooks.Open(dbfile)
objExcelApp.Visible = True
For x = start_row To end_row
myVar = sheets("xyz"
------------------------------------------------------
This is a snippet of the code it all goes fine the first time, but on trying it for a second file, it doesnt make it past the myVar line. Although if i shut the whole app down and restart it works fine first time but not second, regardless of which file i choose