By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,326 Members | 2,726 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,326 IT Pros & Developers. It's quick & easy.

How to Alter an Excel Spreadsheet After Export from Access

100+
P: 121
I have a process that exports a set of records from Access to a Spreadsheet. I would like to hide the second row if possible.

Is there a way to do this through VB?

Thanks for any help I can get.
May 6 '07 #1
Share this Question
Share on Google+
3 Replies


100+
P: 121
This is my current code:

Expand|Select|Wrap|Line Numbers
  1. Private Function Connect(ByVal strVvPathAndFileNameOfExcelSpreadsheet As String) As Boolean
  2. ' Make and open a connection to a given Excel spreadsheet
  3.  
  4.   Set cnMvConnection = New ADODB.Connection
  5.   With cnMvConnection
  6.     .Provider = "Microsoft.Jet.OLEDB.4.0"
  7.     .ConnectionString = "Data Source=" & strVvPathAndFileNameOfExcelSpreadsheet & ";Extended Properties=Excel 8.0;"
  8.     .Open
  9.     .Sheets("ERR_REPRT").Select
  10.     .Rows("2:2").Select
  11.     .Selection.Entirerow.Hidden = True
  12.   End With
  13.  
  14.  
  15. End Function
  16.  
  17. Function CHANGE_XLS()
  18.  
  19.  
  20. Call Connect("C:\TEST.xls")
  21. End Function
But I get an "Arguments are of the wrong type, are out of acceptable range or in direct conflict with another...." error
May 6 '07 #2

100+
P: 121
Does anybody have any ideas here?
May 7 '07 #3

Dököll
Expert 100+
P: 2,364
Does anybody have any ideas here?
Hello, JHNielson!

I am still reading up on this for you, I did not want to respond with out anything, lloks like you need this.

Please stay tuned!

Oh, you have .Selection.Entirerow.Hidden = True, should it be .Selection.EntireRow.Hidden = True?

Please stay tuned!

Dököll
May 8 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.