• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1312
  • Last Modified:

Open Excel 2007 data form via vba (showdataform)

I have a problem with ShowDataForm in Excel 2007.

I want to open a dataform with a command button.
The command button is in one sheet and the list with data is in another sheet.
The list is starting in cell B4 with one row of column labels.
The list contain 400 rows and 15 columns.

I have following code in the command button:

Worksheets("BILLISTA").Unprotect
Worksheets("BILLISTA").Activate
ActiveCell.Activate
Worksheets("BILLISTA").Range("B4").Select
ActiveCell.CurrentRegion.Name = "Database"
ActiveSheet.ShowDataForm
Worksheets("BILLISTA").Protect

I get following error message:
In swedish: "Kan inte fastslå vilken rad i listan eller markeringen som innehåller kolumnetiketter och kan därför inte filtrera. Vilket krävs för detta kommandot."
Tried to translate to english: "Can not find out what row in the list or selection that contain column labels and can not filter because of that. Which is necessary for this command."

The list in the sheet BILLISTA is not complicated. It has one row with labels and no empty rows.
Is this a 2007 problem or am I missing something? How can I convince Excel that the first row is the labels?

Best Regards,
Hans
0
barges
Asked:
barges
  • 3
  • 3
1 Solution
 
Patrick MatthewsCommented:
Hans,

Can you upload a (sanitized) copy of your file?

Patrick
0
 
bargesAuthor Commented:
Here is a sanitized file. When I click on the button in sheet KALKYL a data form should open with the list in BILLISTA. Please change file extension from .txt to .xlsm
Excel-problem-20100328.txt
0
 
Patrick MatthewsCommented:
Please load a new file, as that one is not opening in Excel.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
bargesAuthor Commented:
Did you notice my comment on changing the file extension? Since the file extension .xlsm is not allowed to upload, I changed it to .txt. If you change it to .xlsm and open it with Excel 2007 it should work.
0
 
Patrick MatthewsCommented:
Sorry, you're right--I changed it to XLSX by mistake :)

Not sure what the problem is; the data form came up for me as expected...
0
 
bargesAuthor Commented:
When you say it works for you I started to think about language versions. When I Change "Database" to the swedish word "Databas" it works for me to. Thank you! You saved my day! But again I got something to be unhappy about. Microsofts eager to translate things that should not be translated!
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now