Hello to all you Guru's out there.
I know this isn't a new topic and I've done my due diligence looking for an answer but I'm getting an error I haven't seen before in other posts/questions.
I made a Tender Entry-Rev7.11.xlsm file so when the user opens the file it goes directly to the Save as dialog box to save as an Tender Entry-.xlsx file. I inserted the code in the "ThisWorkbook" section using the Workbook_Open event. I did this so the user cannot enter data in the original file. Yes, I know they could put the file into a template folder but the users lack of computer expertise is rampant.
Here is my code:
And this is the error I'm getting:
Run-time error '1004':
This extension cannot be used with the selected file type. Change the file extension in the File name text box or select a different file type by changing the Save as type.
I did everything manually at first to see exactly what is happening at every step taking note on what pop-ups are opening, shown messages and what choices I have to make. I think I'm missing a step somewhere but because of my lack of VBA experience/knowledge, here I am wanting to learn more.
I appreciate any and all help.
Thanks,
Derick
I know this isn't a new topic and I've done my due diligence looking for an answer but I'm getting an error I haven't seen before in other posts/questions.
I made a Tender Entry-Rev7.11.xlsm file so when the user opens the file it goes directly to the Save as dialog box to save as an Tender Entry-.xlsx file. I inserted the code in the "ThisWorkbook" section using the Workbook_Open event. I did this so the user cannot enter data in the original file. Yes, I know they could put the file into a template folder but the users lack of computer expertise is rampant.
Here is my code:
VBA Code:
Option Explicit
Private Sub Workbook_Open()
Dim strDefaultPath As String
Dim strDefaultName As String
Dim strDialogBoxName As String
Dim strFilePath As String
strDefaultPath = ThisWorkbook.Path
strDefaultName = "Tender Entry-"
strDialogBoxName = "Tender Entry File Name & Location"
strFilePath = Application.GetSaveAsFilename(InitialFileName:=strDefaultName, fileFilter:="Excel Workbook (*.xlsx), *.xlsx", FilterIndex:=51, Title:=strDialogBoxName)
If strFilePath = "False" Then
Exit Sub
Else
ActiveWorkbook.SaveAs Filename:=strFilePath 'This is where the error is highlighted when I select Debug on the error message
End If
End Sub
Run-time error '1004':
This extension cannot be used with the selected file type. Change the file extension in the File name text box or select a different file type by changing the Save as type.
I did everything manually at first to see exactly what is happening at every step taking note on what pop-ups are opening, shown messages and what choices I have to make. I think I'm missing a step somewhere but because of my lack of VBA experience/knowledge, here I am wanting to learn more.
I appreciate any and all help.
Thanks,
Derick