problem of save in excel
-
hello i am developing an application where i generate my report in excel and have to save in some folder in c drive i wrote my code like
Dim xl As New Excel.Application
xl = CreateObject("Excel.Application")
Workbooks.Add()
xl.Visible = Truexl.Columns("A").columnwidth = 5 xl.Columns("C").columnwidth = 25 xl.Columns("B").columnwidth = 25
With xl.Range("A" & ii, "C" & ii)
.Interior.ColorIndex = 5
End With'please suggest also how to change forecolor of cell from "A" to "C"' i get my data from data base and load it in excel and it is working but now i want to save this file in some folder for that i wrote code like
If Not IO.Directory.Exists("C:\Backup") Then
IO.Directory.CreateDirectory("C:\Backup")
End If
xl.SaveWorkspace(" C:\Backup ")but this code is not working so,please suggest what shall i do to save it in this directory... :) :)
-
hello i am developing an application where i generate my report in excel and have to save in some folder in c drive i wrote my code like
Dim xl As New Excel.Application
xl = CreateObject("Excel.Application")
Workbooks.Add()
xl.Visible = Truexl.Columns("A").columnwidth = 5 xl.Columns("C").columnwidth = 25 xl.Columns("B").columnwidth = 25
With xl.Range("A" & ii, "C" & ii)
.Interior.ColorIndex = 5
End With'please suggest also how to change forecolor of cell from "A" to "C"' i get my data from data base and load it in excel and it is working but now i want to save this file in some folder for that i wrote code like
If Not IO.Directory.Exists("C:\Backup") Then
IO.Directory.CreateDirectory("C:\Backup")
End If
xl.SaveWorkspace(" C:\Backup ")but this code is not working so,please suggest what shall i do to save it in this directory... :) :)
-
hello i am developing an application where i generate my report in excel and have to save in some folder in c drive i wrote my code like
Dim xl As New Excel.Application
xl = CreateObject("Excel.Application")
Workbooks.Add()
xl.Visible = Truexl.Columns("A").columnwidth = 5 xl.Columns("C").columnwidth = 25 xl.Columns("B").columnwidth = 25
With xl.Range("A" & ii, "C" & ii)
.Interior.ColorIndex = 5
End With'please suggest also how to change forecolor of cell from "A" to "C"' i get my data from data base and load it in excel and it is working but now i want to save this file in some folder for that i wrote code like
If Not IO.Directory.Exists("C:\Backup") Then
IO.Directory.CreateDirectory("C:\Backup")
End If
xl.SaveWorkspace(" C:\Backup ")but this code is not working so,please suggest what shall i do to save it in this directory... :) :)
-
hello i am developing an application where i generate my report in excel and have to save in some folder in c drive i wrote my code like
Dim xl As New Excel.Application
xl = CreateObject("Excel.Application")
Workbooks.Add()
xl.Visible = Truexl.Columns("A").columnwidth = 5 xl.Columns("C").columnwidth = 25 xl.Columns("B").columnwidth = 25
With xl.Range("A" & ii, "C" & ii)
.Interior.ColorIndex = 5
End With'please suggest also how to change forecolor of cell from "A" to "C"' i get my data from data base and load it in excel and it is working but now i want to save this file in some folder for that i wrote code like
If Not IO.Directory.Exists("C:\Backup") Then
IO.Directory.CreateDirectory("C:\Backup")
End If
xl.SaveWorkspace(" C:\Backup ")but this code is not working so,please suggest what shall i do to save it in this directory... :) :)
Well, the save fails because you haven't provided a file name. You gave it the anme of a folder, but no filename...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008