N
Norek
I have a problem again, when i generate excel report i want to save it
and close the excel
Somtimes my macro working (When i open file first time, first run is ok
but next i have error: Object variable or with block variable not set)
sometimes doesn't and i dont know why , i think that problem is with
activate excel workbook but i don't know the solution
Public Sub CommandButton1_Click()
Dim EXC As Object
pth = VBA.FileSystem.CurDir
VBA.SendKeys ("{ENTER}")
Visio.Addons("VisRpt").Run ("/rptDefName=Report /rptOutput=excel")
Set EXC = Excel.ActiveWorkbook 'not always it's active :/ hmmm
EXC.SaveAs FileName:=pth + "\report.xls"
EXC.Close
Set EXC = Nothing
End Sub
Thnx for any help
Regards,
Norek
and close the excel
Somtimes my macro working (When i open file first time, first run is ok
but next i have error: Object variable or with block variable not set)
sometimes doesn't and i dont know why , i think that problem is with
activate excel workbook but i don't know the solution
Public Sub CommandButton1_Click()
Dim EXC As Object
pth = VBA.FileSystem.CurDir
VBA.SendKeys ("{ENTER}")
Visio.Addons("VisRpt").Run ("/rptDefName=Report /rptOutput=excel")
Set EXC = Excel.ActiveWorkbook 'not always it's active :/ hmmm
EXC.SaveAs FileName:=pth + "\report.xls"
EXC.Close
Set EXC = Nothing
End Sub
Thnx for any help
Regards,
Norek